maspack.matrix

## Class Point2d

• All Implemented Interfaces:
java.lang.Cloneable, Vector, VectorObject<Vector2d>, Clonable, Scannable

```public class Point2d
extends Vector2d```
A 2D spatial point. The only difference between a point and a vector is in the the way it is transformed by an affine transformation. In homogeneous coordinates, a point is assigned a 1 in for its third entry, so the affine transformation of a point takes the form
A p + b
• ### Field Summary

Fields
Modifier and Type Field and Description
`static Point2d` `ZERO`
Global zero point.
• ### Fields inherited from class maspack.matrix.Vector2d

`ONES, x, X_UNIT, y, Y_UNIT`
• ### Constructor Summary

Constructors
Constructor and Description
`Point2d()`
Creates a Point2d and initializes it to zero.
`Point2d(double[] values)`
Creates a Point2d with the supplied element values.
```Point2d(double x, double y)```
Creates a Point2d with the supplied element values.
`Point2d(Vector2d v)`
Creates a Point2d by copying a vector
• ### Method Summary

All Methods
Modifier and Type Method and Description
`void` `inverseTransform(AffineTransform2dBase X)`
Applies an inverse affine transformation to this point, in place.
`void` ```inverseTransform(AffineTransform2dBase X, Vector2d p1)```
Applies an inverse affine transformation to the point p1, and places the result in this vector.
`void` `transform(AffineTransform2dBase X)`
Applies a affine transformation to this point, in place.
`void` ```transform(AffineTransform2dBase X, Vector2d p1)```
Applies a affine transformation to the point p1, and places the result in this point.
• ### Methods inherited from class maspack.matrix.Vector2d

`absolute, absolute, add, add, add, addObj, angle, clone, combine, cross, cross, distance, distanceSquared, dot, epsilonEquals, equals, get, get, get, infinityNorm, interpolate, interpolate, inverseTransform, inverseTransform, length, lengthSquared, max, maxAbsIndex, maxElement, min, minAbsIndex, minElement, negate, negate, normalize, normalize, oneNorm, perpendicular, rotate, scale, scale, scaledAdd, scaledAdd, scaledAddObj, scaleObj, set, set, set, set, set, set, setRandom, setRandom, setRandom, setZero, size, sort, sort, sortAbsolute, sub, sub, transform, transform, updateBounds`
• ### Methods inherited from class maspack.matrix.VectorBase

`containsNaN, copy, copyAndAdd, copyAndNegate, copyAndScale, copyAndSub, copyAndSubLeft, dot, epsilonEquals, equals, get, getDefaultFormat, hasNaN, isColumnVectorStringsVertical, isFixedSize, isRowVector, isWritable, norm, normSquared, scan, scan, set, set, setColumnVectorStringsVertical, setDefaultFormat, setRowVector, setSize, toString, toString, toString, write, write, write, writeToFile`
• ### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`
• ### Methods inherited from interface maspack.util.Scannable

`isWritable, scan, write`
• ### Field Detail

• #### ZERO

`public static final Point2d ZERO`
Global zero point. Should not be modified.
• ### Constructor Detail

• #### Point2d

`public Point2d()`
Creates a Point2d and initializes it to zero.
• #### Point2d

`public Point2d(Vector2d v)`
Creates a Point2d by copying a vector
Parameters:
`v` - vector to be copied
• #### Point2d

```public Point2d(double x,
double y)```
Creates a Point2d with the supplied element values.
Parameters:
`x` - first element
`y` - second element
• #### Point2d

`public Point2d(double[] values)`
Creates a Point2d with the supplied element values.
Parameters:
`values` - element values
• ### Method Detail

• #### transform

`public void transform(AffineTransform2dBase X)`
Applies a affine transformation to this point, in place.
Overrides:
`transform` in class `Vector2d`
Parameters:
`X` - affine transformation
• #### transform

```public void transform(AffineTransform2dBase X,
Vector2d p1)```
Applies a affine transformation to the point p1, and places the result in this point.
Overrides:
`transform` in class `Vector2d`
Parameters:
`X` - affine transformation
`p1` - point to be transformed
• #### inverseTransform

`public void inverseTransform(AffineTransform2dBase X)`
Applies an inverse affine transformation to this point, in place.
Overrides:
`inverseTransform` in class `Vector2d`
Parameters:
`X` - affine transformation
• #### inverseTransform

```public void inverseTransform(AffineTransform2dBase X,
Vector2d p1)```
Applies an inverse affine transformation to the point p1, and places the result in this vector.
Overrides:
`inverseTransform` in class `Vector2d`
Parameters:
`X` - affine transformation
`p1` - point to be transformed