# SkIPoint Reference

SkIPoint holds two 32-bit integer coordinates.

Sets fX to x, fY to y.

SkIPoint (x, y)

### Example

#### Example Output

```pt1 == pt2
```

set() SkPoint::iset() SkPoint::Make

Returns x-axis value of SkIPoint.

fX

### Example

#### Example Output

```pt1.fX == pt1.x()
```

y() SkPoint::x()

Returns y-axis value of SkIPoint.

fY

### Example

#### Example Output

```pt1.fY == pt1.y()
```

x() SkPoint::y()

Returns true if fX and fY are both zero.

### Return Value

true if fX is zero and fY is zero

### Example

#### Example Output

```pt.isZero() == true
```

SkPoint::isZero

Sets fX to x and fY to y.

### Example

#### Example Output

```pt1 == pt2
```

Make

Returns SkIPoint changing the signs of fX and fY.

### Return Value

SkIPoint as (-fX, -fY)

### Example

#### Example Output

```pt: 0, 0  negate: 0, 0
pt: -1, -2  negate: 1, 2
pt: 2147483647, -2147483647  negate: -2147483647, 2147483647
pt: -2147483648, -2147483648  negate: -2147483648, -2147483648
```

operator-(const SkIPoint& a, const SkIPoint& b) operator-=(const SkIVector& v) SkPoint::operator-() const

Offsets IPoint by IVector v. Sets IPoint to (fX + v.fX, fY + v.fY).

### Example

operator+(const SkIPoint& a, const SkIVector& b) SkPoint::operator+=(const SkVector& v)

Subtracts IVector v from IPoint. Sets IPoint to: (fX - v.fX, fY - v.fY).

### Example

operator-(const SkIPoint& a, const SkIPoint& b) SkPoint::operator-=(const SkVector& v)

Returns true if SkIPoint is equivalent to SkIPoint constructed from (x, y).

### Return Value

true if SkIPoint equals (x, y)

### Example

#### Example Output

```pt: 0, 0  == pt
pt: -1, -2  == pt
pt: 2147483647, -1  == pt
pt: -2147483648, -1  == pt
```

operator==(const SkIPoint& a, const SkIPoint& b)

Returns true if a is equivalent to b.

### Return Value

true if a.fX == b.fX and a.fY == b.fY

### Example

#### Example Output

```pt: 0, 0  == pt
pt: -1, -2  == pt
pt: 2147483647, -1  == pt
pt: -2147483648, -1  == pt
```

equals() operator!=(const SkIPoint& a, const SkIPoint& b)

Returns true if a is not equivalent to b.

### Return Value

true if a.fX != b.fX or a.fY != b.fY

### Example

#### Example Output

```pt: 0, 0  == pt
pt: -1, -2  == pt
pt: 2147483647, -1  == pt
pt: -2147483648, -1  == pt
```

operator==(const SkIPoint& a, const SkIPoint& b) equals()

Returns IVector from b to a; computed as (a.fX - b.fX, a.fY - b.fY).

Can also be used to subtract IVector from IVector, returning IVector.

### Return Value

IVector from b to a

### Example

operator-=(const SkIVector& v)

Returns IPoint resulting from IPoint a offset by IVector b, computed as: (a.fX + b.fX, a.fY + b.fY).

Can also be used to offset IPoint b by IVector a, returning IPoint. Can also be used to add IVector to IVector, returning IVector.

### Return Value

IPoint equal to a offset by b

### Example

operator+=(const SkIVector& v)

SkIVector provides an alternative name for SkIPoint. SkIVector and SkIPoint can be used interchangeably for all purposes.