| Name |
Description |
|
| constructor(x: number = 0, y: number = 0): Point2d |
Constructor for Point2d |
|
| addForwardLeft(tangentFraction: number, leftFraction: number, vector: Vector2d): Point2d |
Starting at this point, move along vector by tangentFraction of the vector length, and then |
|
| clone(result?: Point2d): Point2d |
return a new Point2d with x,y coordinates from this. |
|
| crossProductToPoints(target1: Readonly<WritableXAndY>, target2: Readonly<WritableXAndY>): number |
Returns the (scalar) cross product of vector from this to targetA and vector from this to targetB |
|
| dotVectorsToTargets(targetA: Readonly<WritableXAndY>, targetB: Readonly<WritableXAndY>): number |
Return the dot product of vector from this to targetA and vector from this to targetB |
|
| forwardLeftInterpolate(tangentFraction: number, leftFraction: number, point: Readonly<WritableXAndY>): Point2d |
Interpolate at tangentFraction between this instance and point, and then Move by leftFraction |
|
| fractionOfProjectionToLine(startPoint: Point2d, endPoint: Point2d, defaultFraction: number = 0): number |
Return the fractional coordinate of the projection of this instance x,y onto the |
|
| interpolate(fraction: number, other: Readonly<WritableXAndY>, result?: Point2d): Point2d |
Return a point interpolated between this point and the right param. |
|
| interpolateXY(fractionX: number, fractionY: number, other: Readonly<WritableXAndY>, result?: Point2d): Point2d |
Return a point with independent x,y fractional interpolation. |
|
| minus(vector: Readonly<WritableXAndY>, result?: Point2d): Point2d |
Return this point minus vector |
|
| plus(vector: Readonly<WritableXAndY>, result?: Point2d): Point2d |
Return point plus vector |
|
| plus2Scaled(vectorA: Readonly<WritableXAndY>, scalarA: number, vectorB: Readonly<WritableXAndY>, scalarB: number, result?: Point2d): Point2d |
Return point + vectorA * scalarA + vectorB * scalarB |
|
| plus3Scaled(vectorA: Readonly<WritableXAndY>, scalarA: number, vectorB: Readonly<WritableXAndY>, scalarB: number, vectorC: Readonly<WritableXAndY>, scalarC: number, result?: Point2d): Point2d |
Return point + vectorA * scalarA + vectorB * scalarB + vectorC * scalarC |
|
| plusScaled(vector: Readonly<WritableXAndY>, scaleFactor: number, result?: Point2d): Point2d |
Return point + vector * scalar |
|
| plusXY(dx: number = 0, dy: number = 0, result?: Point2d): Point2d |
Return point plus vector |
|
| create(x: number = 0, y: number = 0, result?: Point2d): Point2d Static |
Return a point (newly created unless result provided) with given x,y coordinates |
|
| createFrom(xy: undefined | Readonly<WritableXAndY>, result?: Point2d): Point2d Static |
Create (or optionally reuse) a Point2d from another object with fields x and y |
|
| createZero(result?: Point2d): Point2d Static |
Create a Point2d with both coordinates zero. |
|
| fromJSON(json?: XYProps): Point2d Static |
Set x and y from a JSON input such as [1,2] or {x:1, y:2} |
|