@itwin/core-geometry 4.0.0-dev.66 → 4.0.0-dev.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/Geometry.d.ts +367 -243
- package/lib/cjs/Geometry.d.ts.map +1 -1
- package/lib/cjs/Geometry.js +481 -311
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +6 -4
- package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/cjs/clipping/ConvexClipPlaneSet.js +9 -7
- package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +5 -3
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +4 -2
- package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +4 -4
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +17 -9
- package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/cjs/geometry3d/Point2dVector2d.js +2 -2
- package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts +13 -7
- package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Point3dVector3d.js +19 -18
- package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/cjs/geometry4d/Point4d.d.ts +1 -1
- package/lib/cjs/geometry4d/Point4d.d.ts.map +1 -1
- package/lib/cjs/geometry4d/Point4d.js +12 -13
- package/lib/cjs/geometry4d/Point4d.js.map +1 -1
- package/lib/esm/Geometry.d.ts +367 -243
- package/lib/esm/Geometry.d.ts.map +1 -1
- package/lib/esm/Geometry.js +481 -311
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +6 -4
- package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
- package/lib/esm/clipping/ConvexClipPlaneSet.js +9 -7
- package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +5 -3
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +4 -2
- package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +4 -4
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +17 -9
- package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
- package/lib/esm/geometry3d/Point2dVector2d.js +2 -2
- package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.d.ts +13 -7
- package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Point3dVector3d.js +19 -18
- package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
- package/lib/esm/geometry4d/Point4d.d.ts +1 -1
- package/lib/esm/geometry4d/Point4d.d.ts.map +1 -1
- package/lib/esm/geometry4d/Point4d.js +12 -13
- package/lib/esm/geometry4d/Point4d.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plane3dByOriginAndUnitNormal.js","sourceRoot":"","sources":["../../../src/geometry3d/Plane3dByOriginAndUnitNormal.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAA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AO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnE,CAAC;IACD,2EAA2E;IACpE,YAAY,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACvE,CAAC;IACD,0DAA0D;IACnD,mBAAmB,CAAC,UAAmB,EAAE,MAAgB;QAC9D,OAAO,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC;IACjH,CAAC;IACD;;MAEE;IACc,cAAc,CAAC,UAAmB,EAAE,YAAoB,QAAQ,CAAC,mBAAmB;QAClG,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAC3E,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC;IACzC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\nimport { AxisOrder, BeJSONFunctions, Geometry } from \"../Geometry\";\r\nimport { Plane3d } from \"./Plane3d\";\r\nimport { Point4d } from \"../geometry4d/Point4d\";\r\nimport { Angle } from \"./Angle\";\r\nimport { Matrix3d } from \"./Matrix3d\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { Transform } from \"./Transform\";\r\nimport { XAndY } from \"./XYZProps\";\r\n\r\n/**\r\n * A plane defined by\r\n * * Any point on the plane.\r\n * * a unit normal.\r\n * @public\r\n */\r\nexport class Plane3dByOriginAndUnitNormal extends Plane3d implements BeJSONFunctions {\r\n private _origin: Point3d;\r\n private _normal: Vector3d;\r\n // constructor captures references !!!\r\n private constructor(origin: Point3d, normal: Vector3d) {\r\n super();\r\n this._origin = origin;\r\n this._normal = normal;\r\n }\r\n // This is private because it does not check validity of the unit vector.\r\n private static _create(x: number, y: number, z: number, u: number, v: number, w: number) {\r\n return new Plane3dByOriginAndUnitNormal(Point3d.create(x, y, z), Vector3d.create(u, v, w));\r\n }\r\n /**\r\n * Create a plane parallel to the XY plane\r\n * @param origin optional plane origin. If omitted, the origin is placed at 000\r\n */\r\n public static createXYPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\r\n if (origin)\r\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 0, 0, 1);\r\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 0, 0, 1);\r\n }\r\n /**\r\n * Create a plane parallel to the YZ plane\r\n * @param origin optional plane origin. If omitted, the origin is placed at 000\r\n */\r\n public static createYZPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\r\n if (origin)\r\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 1, 0, 0);\r\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 1, 0, 0);\r\n }\r\n /**\r\n * Create a plane parallel to the ZX plane\r\n * @param origin optional plane origin. If omitted, the origin is placed at 000\r\n */\r\n public static createZXPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\r\n if (origin)\r\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 0, 1, 0);\r\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 0, 1, 0);\r\n }\r\n /** create a new Plane3dByOriginAndUnitNormal with given origin and normal.\r\n * * The inputs are NOT captured.\r\n * * Returns undefined if the normal vector is all zeros.\r\n */\r\n public static create(origin: Point3d, normal: Vector3d, result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined {\r\n const normalized = normal.normalize();\r\n if (!normalized)\r\n return undefined;\r\n if (result) {\r\n result.set(origin, normalized);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndUnitNormal(origin.clone(), normalized);\r\n }\r\n /** create a new Plane3dByOriginAndUnitNormal from a variety of plane types.\r\n * * The inputs are NOT captured.\r\n * * Returns undefined if the normal vector is all zeros.\r\n */\r\n public static createFrom(source: Plane3d, result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined {\r\n if (source instanceof Plane3dByOriginAndUnitNormal)\r\n return source.clone(result);\r\n const normal = source.getUnitNormal();\r\n if (normal === undefined)\r\n return undefined;\r\n const origin = source.getAnyPointOnPlane();\r\n return this.create(origin, normal, result);\r\n }\r\n\r\n /** create a new Plane3dByOriginAndUnitNormal with direct coordinates of origin and normal.\r\n * * Returns undefined if the normal vector is all zeros.\r\n * * If unable to normalize return undefined. (And if result is given it is left unchanged)\r\n */\r\n public static createXYZUVW(ax: number, ay: number, az: number, ux: number, uy: number, uz: number, result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined {\r\n const magU = Geometry.hypotenuseXYZ(ux, uy, uz);\r\n if (magU < Geometry.smallMetricDistance)\r\n return undefined;\r\n if (result) {\r\n result._origin.set(ax, ay, az);\r\n result._normal.set(ux / magU, uy / magU, uz / magU);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndUnitNormal(Point3d.create(ax, ay, az), Vector3d.create(ux / magU, uy / magU, uz / magU));\r\n }\r\n /** create a new Plane3dByOriginAndUnitNormal with unit normal (a) in the xy plane (b) perpendicular to the line defined by xy parts of origin to target.\r\n * * origin and normal both have z = 0.\r\n * * The inputs are NOT captured.\r\n * * Returns undefined if the normal vector is all zeros.\r\n */\r\n public static createOriginAndTargetXY(origin: XAndY, target: XAndY, result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined {\r\n const ux = target.x - origin.x;\r\n const uy = target.y - origin.y;\r\n return this.createXYZUVW(origin.x, origin.y, 0.0, uy, -ux, 0.0, result);\r\n }\r\n\r\n /** create a new Plane3dByOriginAndUnitNormal with xy origin (at z=0) and normal angle in xy plane.\r\n * * Returns undefined if the normal vector is all zeros.\r\n */\r\n public static createXYAngle(x: number, y: number, normalAngleFromX: Angle, result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal {\r\n if (result) {\r\n result._origin.set(x, y, 0.0);\r\n result._normal.set(normalAngleFromX.cos(), normalAngleFromX.sin(), 0.0);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndUnitNormal(Point3d.create(x, y, 0), Vector3d.create(normalAngleFromX.cos(), normalAngleFromX.sin()));\r\n }\r\n\r\n /** Create a plane defined by two points and an in-plane vector.\r\n * @param pointA any point in the plane\r\n * @param pointB any other point in the plane\r\n * @param vector any vector in the plane but not parallel to the vector from pointA to pointB\r\n */\r\n public static createPointPointVectorInPlane(pointA: Point3d, pointB: Point3d, vector: Vector3d): Plane3dByOriginAndUnitNormal | undefined {\r\n const cross = vector.crossProductStartEnd(pointA, pointB);\r\n if (cross.tryNormalizeInPlace())\r\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\r\n return undefined;\r\n }\r\n\r\n /** Create a plane defined by three points.\r\n * @param pointA any point in the plane. This will be the origin.\r\n * @param pointB any other point in the plane\r\n * @param pointC any third point in the plane but not on the line of pointA and pointB\r\n */\r\n public static createOriginAndTargets(pointA: Point3d, pointB: Point3d, pointC: Point3d): Plane3dByOriginAndUnitNormal | undefined {\r\n const cross = pointA.crossProductToPoints(pointB, pointC);\r\n if (cross.tryNormalizeInPlace())\r\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\r\n return undefined;\r\n }\r\n\r\n /** Create a plane defined by a point and two vectors in the plane\r\n * @param pointA any point in the plane\r\n * @param vectorB any vector in the plane\r\n * @param vectorC any vector in the plane but not parallel to vectorB\r\n */\r\n public static createOriginAndVectors(pointA: Point3d, vectorB: Vector3d, vectorC: Vector3d): Plane3dByOriginAndUnitNormal | undefined {\r\n const cross = vectorB.crossProduct(vectorC);\r\n if (cross.tryNormalizeInPlace())\r\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\r\n return undefined;\r\n }\r\n\r\n /** test for (toleranced) equality with `other` */\r\n public isAlmostEqual(other: Plane3dByOriginAndUnitNormal): boolean {\r\n return this._origin.isAlmostEqual(other._origin) && this._normal.isAlmostEqual(other._normal);\r\n }\r\n /** Parse a json fragment `{origin: [x,y,z], normal: [ux,uy,uz]}` */\r\n public setFromJSON(json?: any) {\r\n if (!json) {\r\n this._origin.set(0, 0, 0);\r\n this._normal.set(0, 0, 1);\r\n } else {\r\n this._origin.setFromJSON(json.origin);\r\n this._normal.setFromJSON(json.normal);\r\n }\r\n }\r\n /**\r\n * Convert to a JSON object.\r\n * @return {*} [origin,normal]\r\n */\r\n public toJSON(): any { return { origin: this._origin.toJSON(), normal: this._normal.toJSON() }; }\r\n /** create a new Plane3dByOriginAndUnitNormal from json fragment.\r\n * * See `Plane3dByOriginAndUnitNormal.setFromJSON`\r\n */\r\n public static fromJSON(json?: any): Plane3dByOriginAndUnitNormal {\r\n const result = Plane3dByOriginAndUnitNormal.createXYPlane();\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n /** Return a reference to the origin. */\r\n public getOriginRef(): Point3d { return this._origin; }\r\n /** Return a reference to the unit normal. */\r\n public getNormalRef(): Vector3d { return this._normal; }\r\n\r\n /** Return coordinate axes (as a transform) with\r\n * * origin at plane origin\r\n * * z axis in direction of plane normal.\r\n * * x,y axes in plane.\r\n */\r\n public getLocalToWorld(): Transform {\r\n const axes = Matrix3d.createRigidHeadsUp(this._normal, AxisOrder.ZXY);\r\n return Transform.createRefs(this._origin.clone(), axes);\r\n }\r\n /** Return a (singular) transform which projects points to this plane.\r\n */\r\n public getProjectionToPlane(): Transform {\r\n const axes = Matrix3d.createIdentity();\r\n axes.addScaledOuterProductInPlace(this._normal, this._normal, -1.0);\r\n axes.markSingular();\r\n return Transform.createFixedPointAndMatrix(this._origin, axes);\r\n }\r\n\r\n /** Copy coordinates from the given origin and normal. */\r\n public set(origin: Point3d, normal: Vector3d): void {\r\n this._origin.setFrom(origin);\r\n this._normal.setFrom(normal);\r\n }\r\n /** return a deep clone (point and normal cloned) */\r\n public clone(result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal {\r\n if (result) {\r\n result.set(this._origin, this._normal);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndUnitNormal(this._origin.clone(), this._normal.clone());\r\n }\r\n /** Create a clone and return the transform of the clone. */\r\n public cloneTransformed(transform: Transform, inverse: boolean = false): Plane3dByOriginAndUnitNormal | undefined {\r\n const result = this.clone();\r\n if (inverse) {\r\n transform.multiplyInversePoint3d(result._origin, result._origin);\r\n if (transform.matrix.multiplyTransposeVector(result._normal, result._normal) !== undefined\r\n && result._normal.normalizeInPlace())\r\n return result;\r\n } else {\r\n transform.multiplyPoint3d(result._origin, result._origin);\r\n if (transform.matrix.multiplyInverseTranspose(result._normal, result._normal) !== undefined\r\n && result._normal.normalizeInPlace())\r\n return result;\r\n }\r\n return undefined;\r\n }\r\n /** Copy data from the given plane. */\r\n public setFrom(source: Plane3dByOriginAndUnitNormal): void {\r\n this.set(source._origin, source._normal);\r\n }\r\n /** Return the altitude of spacePoint above or below the plane. (Below is negative) */\r\n public altitude(spacePoint: Point3d): number { return this._normal.dotProductStartEnd(this._origin, spacePoint); }\r\n /** Return the altitude of point (x,y) given xy parts using only the xy parts of origin and unit normal */\r\n public altitudeXY(x: number, y: number): number {\r\n return (x - this._origin.x) * this._normal.x + (y - this._origin.y) * this._normal.y;\r\n }\r\n /**\r\n * Return the x component of the normal used to evaluate altitude.\r\n */\r\n public normalX(): number { return this._normal.x; }\r\n /**\r\n * Return the x component of the normal used to evaluate altitude.\r\n */\r\n public normalY(): number { return this._normal.y; }\r\n /**\r\n * Return the z component of the normal used to evaluate altitude.\r\n */\r\n public normalZ(): number { return this._normal.z; }\r\n /**\r\n * Return (a clone of) the unit normal.\r\n */\r\n public override getUnitNormal(result?: Vector3d): Vector3d | undefined {\r\n return this._normal.clone(result);\r\n }\r\n /**\r\n * Return (a clone of) the origin.\r\n */\r\n public override getAnyPointOnPlane(result?: Point3d): Point3d {\r\n return this._origin.clone(result);\r\n }\r\n /** Return the signed altitude of weighted spacePoint above or below the plane. (Below is negative) */\r\n public weightedAltitude(spacePoint: Point4d): number {\r\n return this._normal.dotProductStart3dEnd4d(this._origin, spacePoint);\r\n }\r\n\r\n /** return any point at specified (signed) altitude. */\r\n public altitudeToPoint(altitude: number, result?: Point3d): Point3d {\r\n return this._origin.plusScaled(this._normal, altitude, result);\r\n }\r\n /** Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\r\n * for a point moving at speed one along the spaceVector.\r\n */\r\n public velocityXYZ(x: number, y: number, z: number): number { return this._normal.dotProductXYZ(x, y, z); }\r\n /** Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\r\n * for a point moving at speed one along the spaceVector.\r\n */\r\n public velocity(spaceVector: Vector3d): number { return this._normal.dotProduct(spaceVector); }\r\n /** Return the altitude of a point given as separate x,y,z components. */\r\n public altitudeXYZ(x: number, y: number, z: number): number {\r\n return this._normal.dotProductStartEndXYZ(this._origin, x, y, z);\r\n }\r\n /** Return the altitude of a point given as separate x,y,z,w components. */\r\n public altitudeXYZW(x: number, y: number, z: number, w: number): number {\r\n return this._normal.dotProductStartEndXYZW(this._origin, x, y, z, w);\r\n }\r\n /** Return the projection of spacePoint onto the plane. */\r\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\r\n return spacePoint.plusScaled(this._normal, -this._normal.dotProductStartEnd(this._origin, spacePoint), result);\r\n }\r\n /** Returns true if spacePoint is within distance tolerance of the plane.\r\n * * This logic is identical to the [[Plane3d]] method but avoids a level of function call.\r\n */\r\n public override isPointInPlane(spacePoint: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\r\n const altitude = this._normal.dotProductStartEnd(this._origin, spacePoint);\r\n return Math.abs(altitude) <= tolerance;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Plane3dByOriginAndUnitNormal.js","sourceRoot":"","sources":["../../../src/geometry3d/Plane3dByOriginAndUnitNormal.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,SAAS,EAAmB,QAAQ,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;;;;GAKG;AACH,MAAM,OAAO,4BAA6B,SAAQ,OAAO;IAGvD,sCAAsC;IACtC,YAAoB,MAAe,EAAE,MAAgB;QACnD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IACD,yEAAyE;IACjE,MAAM,CAAC,OAAO,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;QACrF,OAAO,IAAI,4BAA4B,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7F,CAAC;IACD;;;OAGG;IACI,MAAM,CAAC,aAAa,CAAC,MAAgB;QAC1C,IAAI,MAAM;YACR,OAAO,4BAA4B,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE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,UAAU,CAAC,CAAC;QAC3E,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC;IACzC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\nimport { AxisOrder, BeJSONFunctions, Geometry } from \"../Geometry\";\r\nimport { Plane3d } from \"./Plane3d\";\r\nimport { Point4d } from \"../geometry4d/Point4d\";\r\nimport { Angle } from \"./Angle\";\r\nimport { Matrix3d } from \"./Matrix3d\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { Transform } from \"./Transform\";\r\nimport { XAndY } from \"./XYZProps\";\r\n\r\n/**\r\n * A plane defined by\r\n * * Any point on the plane.\r\n * * a unit normal.\r\n * @public\r\n */\r\nexport class Plane3dByOriginAndUnitNormal extends Plane3d implements BeJSONFunctions {\r\n private _origin: Point3d;\r\n private _normal: Vector3d;\r\n // constructor captures references !!!\r\n private constructor(origin: Point3d, normal: Vector3d) {\r\n super();\r\n this._origin = origin;\r\n this._normal = normal;\r\n }\r\n // This is private because it does not check validity of the unit vector.\r\n private static _create(x: number, y: number, z: number, u: number, v: number, w: number) {\r\n return new Plane3dByOriginAndUnitNormal(Point3d.create(x, y, z), Vector3d.create(u, v, w));\r\n }\r\n /**\r\n * Create a plane parallel to the XY plane\r\n * @param origin optional plane origin. If omitted, the origin is placed at 000\r\n */\r\n public static createXYPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\r\n if (origin)\r\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 0, 0, 1);\r\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 0, 0, 1);\r\n }\r\n /**\r\n * Create a plane parallel to the YZ plane\r\n * @param origin optional plane origin. If omitted, the origin is placed at 000\r\n */\r\n public static createYZPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\r\n if (origin)\r\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 1, 0, 0);\r\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 1, 0, 0);\r\n }\r\n /**\r\n * Create a plane parallel to the ZX plane\r\n * @param origin optional plane origin. If omitted, the origin is placed at 000\r\n */\r\n public static createZXPlane(origin?: Point3d): Plane3dByOriginAndUnitNormal {\r\n if (origin)\r\n return Plane3dByOriginAndUnitNormal._create(origin.x, origin.y, origin.z, 0, 1, 0);\r\n return Plane3dByOriginAndUnitNormal._create(0, 0, 0, 0, 1, 0);\r\n }\r\n /** Create a new Plane3dByOriginAndUnitNormal with given origin and normal.\r\n * * The inputs are NOT captured.\r\n * * Returns undefined if `normal.normalize()` returns undefined.\r\n */\r\n public static create(origin: Point3d, normal: Vector3d, result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined {\r\n if (result) {\r\n if (normal.normalize(result._normal) === undefined)\r\n return undefined;\r\n origin.clone(result._origin);\r\n return result;\r\n }\r\n const normalized = normal.normalize();\r\n if (normalized === undefined)\r\n return undefined;\r\n return new Plane3dByOriginAndUnitNormal(origin.clone(), normalized);\r\n }\r\n /** Create a new Plane3dByOriginAndUnitNormal from a variety of plane types.\r\n * * The inputs are NOT captured.\r\n * * Returns undefined if `source.getUnitNormal()` returns undefined.\r\n */\r\n public static createFrom(source: Plane3d, result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined {\r\n if (source instanceof Plane3dByOriginAndUnitNormal)\r\n return source.clone(result);\r\n if (result) {\r\n if (source.getUnitNormal(result._normal) === undefined)\r\n return undefined;\r\n source.getAnyPointOnPlane(result._origin);\r\n return result;\r\n }\r\n const normal = source.getUnitNormal();\r\n if (normal === undefined)\r\n return undefined;\r\n const origin = source.getAnyPointOnPlane();\r\n return new Plane3dByOriginAndUnitNormal(origin, normal);\r\n }\r\n\r\n /** create a new Plane3dByOriginAndUnitNormal with direct coordinates of origin and normal.\r\n * * Returns undefined if the normal vector is all zeros.\r\n * * If unable to normalize return undefined. (And if result is given it is left unchanged)\r\n */\r\n public static createXYZUVW(ax: number, ay: number, az: number, ux: number, uy: number, uz: number, result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined {\r\n const magU = Geometry.hypotenuseXYZ(ux, uy, uz);\r\n if (magU < Geometry.smallMetricDistance)\r\n return undefined;\r\n if (result) {\r\n result._origin.set(ax, ay, az);\r\n result._normal.set(ux / magU, uy / magU, uz / magU);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndUnitNormal(Point3d.create(ax, ay, az), Vector3d.create(ux / magU, uy / magU, uz / magU));\r\n }\r\n /** create a new Plane3dByOriginAndUnitNormal with unit normal (a) in the xy plane (b) perpendicular to the line defined by xy parts of origin to target.\r\n * * origin and normal both have z = 0.\r\n * * The inputs are NOT captured.\r\n * * Returns undefined if the normal vector is all zeros.\r\n */\r\n public static createOriginAndTargetXY(origin: XAndY, target: XAndY, result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal | undefined {\r\n const ux = target.x - origin.x;\r\n const uy = target.y - origin.y;\r\n return this.createXYZUVW(origin.x, origin.y, 0.0, uy, -ux, 0.0, result);\r\n }\r\n\r\n /** create a new Plane3dByOriginAndUnitNormal with xy origin (at z=0) and normal angle in xy plane.\r\n * * Returns undefined if the normal vector is all zeros.\r\n */\r\n public static createXYAngle(x: number, y: number, normalAngleFromX: Angle, result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal {\r\n if (result) {\r\n result._origin.set(x, y, 0.0);\r\n result._normal.set(normalAngleFromX.cos(), normalAngleFromX.sin(), 0.0);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndUnitNormal(Point3d.create(x, y, 0), Vector3d.create(normalAngleFromX.cos(), normalAngleFromX.sin()));\r\n }\r\n\r\n /** Create a plane defined by two points and an in-plane vector.\r\n * @param pointA any point in the plane\r\n * @param pointB any other point in the plane\r\n * @param vector any vector in the plane but not parallel to the vector from pointA to pointB\r\n */\r\n public static createPointPointVectorInPlane(pointA: Point3d, pointB: Point3d, vector: Vector3d): Plane3dByOriginAndUnitNormal | undefined {\r\n const cross = vector.crossProductStartEnd(pointA, pointB);\r\n if (cross.tryNormalizeInPlace())\r\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\r\n return undefined;\r\n }\r\n\r\n /** Create a plane defined by three points.\r\n * @param pointA any point in the plane. This will be the origin.\r\n * @param pointB any other point in the plane\r\n * @param pointC any third point in the plane but not on the line of pointA and pointB\r\n */\r\n public static createOriginAndTargets(pointA: Point3d, pointB: Point3d, pointC: Point3d): Plane3dByOriginAndUnitNormal | undefined {\r\n const cross = pointA.crossProductToPoints(pointB, pointC);\r\n if (cross.tryNormalizeInPlace())\r\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\r\n return undefined;\r\n }\r\n\r\n /** Create a plane defined by a point and two vectors in the plane\r\n * @param pointA any point in the plane\r\n * @param vectorB any vector in the plane\r\n * @param vectorC any vector in the plane but not parallel to vectorB\r\n */\r\n public static createOriginAndVectors(pointA: Point3d, vectorB: Vector3d, vectorC: Vector3d): Plane3dByOriginAndUnitNormal | undefined {\r\n const cross = vectorB.crossProduct(vectorC);\r\n if (cross.tryNormalizeInPlace())\r\n return new Plane3dByOriginAndUnitNormal(pointA, cross);\r\n return undefined;\r\n }\r\n\r\n /** test for (toleranced) equality with `other` */\r\n public isAlmostEqual(other: Plane3dByOriginAndUnitNormal): boolean {\r\n return this._origin.isAlmostEqual(other._origin) && this._normal.isAlmostEqual(other._normal);\r\n }\r\n /** Parse a json fragment `{origin: [x,y,z], normal: [ux,uy,uz]}` */\r\n public setFromJSON(json?: any) {\r\n if (!json) {\r\n this._origin.set(0, 0, 0);\r\n this._normal.set(0, 0, 1);\r\n } else {\r\n this._origin.setFromJSON(json.origin);\r\n this._normal.setFromJSON(json.normal);\r\n }\r\n }\r\n /**\r\n * Convert to a JSON object.\r\n * @return {*} [origin,normal]\r\n */\r\n public toJSON(): any { return { origin: this._origin.toJSON(), normal: this._normal.toJSON() }; }\r\n /** create a new Plane3dByOriginAndUnitNormal from json fragment.\r\n * * See `Plane3dByOriginAndUnitNormal.setFromJSON`\r\n */\r\n public static fromJSON(json?: any): Plane3dByOriginAndUnitNormal {\r\n const result = Plane3dByOriginAndUnitNormal.createXYPlane();\r\n result.setFromJSON(json);\r\n return result;\r\n }\r\n /** Return a reference to the origin. */\r\n public getOriginRef(): Point3d { return this._origin; }\r\n /** Return a reference to the unit normal. */\r\n public getNormalRef(): Vector3d { return this._normal; }\r\n\r\n /** Return coordinate axes (as a transform) with\r\n * * origin at plane origin\r\n * * z axis in direction of plane normal.\r\n * * x,y axes in plane.\r\n */\r\n public getLocalToWorld(): Transform {\r\n const axes = Matrix3d.createRigidHeadsUp(this._normal, AxisOrder.ZXY);\r\n return Transform.createRefs(this._origin.clone(), axes);\r\n }\r\n /** Return a (singular) transform which projects points to this plane.\r\n */\r\n public getProjectionToPlane(): Transform {\r\n const axes = Matrix3d.createIdentity();\r\n axes.addScaledOuterProductInPlace(this._normal, this._normal, -1.0);\r\n axes.markSingular();\r\n return Transform.createFixedPointAndMatrix(this._origin, axes);\r\n }\r\n\r\n /** Copy coordinates from the given origin and normal. */\r\n public set(origin: Point3d, normal: Vector3d): void {\r\n this._origin.setFrom(origin);\r\n this._normal.setFrom(normal);\r\n }\r\n /** return a deep clone (point and normal cloned) */\r\n public clone(result?: Plane3dByOriginAndUnitNormal): Plane3dByOriginAndUnitNormal {\r\n if (result) {\r\n result.set(this._origin, this._normal);\r\n return result;\r\n }\r\n return new Plane3dByOriginAndUnitNormal(this._origin.clone(), this._normal.clone());\r\n }\r\n /** Create a clone and return the transform of the clone. */\r\n public cloneTransformed(transform: Transform, inverse: boolean = false): Plane3dByOriginAndUnitNormal | undefined {\r\n const result = this.clone();\r\n if (inverse) {\r\n transform.multiplyInversePoint3d(result._origin, result._origin);\r\n if (transform.matrix.multiplyTransposeVector(result._normal, result._normal) !== undefined\r\n && result._normal.normalizeInPlace())\r\n return result;\r\n } else {\r\n transform.multiplyPoint3d(result._origin, result._origin);\r\n if (transform.matrix.multiplyInverseTranspose(result._normal, result._normal) !== undefined\r\n && result._normal.normalizeInPlace())\r\n return result;\r\n }\r\n return undefined;\r\n }\r\n /** Copy data from the given plane. */\r\n public setFrom(source: Plane3dByOriginAndUnitNormal): void {\r\n this.set(source._origin, source._normal);\r\n }\r\n /** Return the altitude of spacePoint above or below the plane. (Below is negative) */\r\n public altitude(spacePoint: Point3d): number { return this._normal.dotProductStartEnd(this._origin, spacePoint); }\r\n /** Return the altitude of point (x,y) given xy parts using only the xy parts of origin and unit normal */\r\n public altitudeXY(x: number, y: number): number {\r\n return (x - this._origin.x) * this._normal.x + (y - this._origin.y) * this._normal.y;\r\n }\r\n /**\r\n * Return the x component of the normal used to evaluate altitude.\r\n */\r\n public normalX(): number { return this._normal.x; }\r\n /**\r\n * Return the x component of the normal used to evaluate altitude.\r\n */\r\n public normalY(): number { return this._normal.y; }\r\n /**\r\n * Return the z component of the normal used to evaluate altitude.\r\n */\r\n public normalZ(): number { return this._normal.z; }\r\n /**\r\n * Return (a clone of) the unit normal.\r\n */\r\n public override getUnitNormal(result?: Vector3d): Vector3d | undefined {\r\n return this._normal.clone(result);\r\n }\r\n /**\r\n * Return (a clone of) the origin.\r\n */\r\n public override getAnyPointOnPlane(result?: Point3d): Point3d {\r\n return this._origin.clone(result);\r\n }\r\n /** Return the signed altitude of weighted spacePoint above or below the plane. (Below is negative) */\r\n public weightedAltitude(spacePoint: Point4d): number {\r\n return this._normal.dotProductStart3dEnd4d(this._origin, spacePoint);\r\n }\r\n\r\n /** return any point at specified (signed) altitude. */\r\n public altitudeToPoint(altitude: number, result?: Point3d): Point3d {\r\n return this._origin.plusScaled(this._normal, altitude, result);\r\n }\r\n /** Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\r\n * for a point moving at speed one along the spaceVector.\r\n */\r\n public velocityXYZ(x: number, y: number, z: number): number { return this._normal.dotProductXYZ(x, y, z); }\r\n /** Return the dot product of spaceVector with the plane's unit normal. This tells the rate of change of altitude\r\n * for a point moving at speed one along the spaceVector.\r\n */\r\n public velocity(spaceVector: Vector3d): number { return this._normal.dotProduct(spaceVector); }\r\n /** Return the altitude of a point given as separate x,y,z components. */\r\n public altitudeXYZ(x: number, y: number, z: number): number {\r\n return this._normal.dotProductStartEndXYZ(this._origin, x, y, z);\r\n }\r\n /** Return the altitude of a point given as separate x,y,z,w components. */\r\n public altitudeXYZW(x: number, y: number, z: number, w: number): number {\r\n return this._normal.dotProductStartEndXYZW(this._origin, x, y, z, w);\r\n }\r\n /** Return the projection of spacePoint onto the plane. */\r\n public projectPointToPlane(spacePoint: Point3d, result?: Point3d): Point3d {\r\n return spacePoint.plusScaled(this._normal, -this._normal.dotProductStartEnd(this._origin, spacePoint), result);\r\n }\r\n /** Returns true if spacePoint is within distance tolerance of the plane.\r\n * * This logic is identical to the [[Plane3d]] method but avoids a level of function call.\r\n */\r\n public override isPointInPlane(spacePoint: Point3d, tolerance: number = Geometry.smallMetricDistance): boolean {\r\n const altitude = this._normal.dotProductStartEnd(this._origin, spacePoint);\r\n return Math.abs(altitude) <= tolerance;\r\n }\r\n}\r\n"]}
|
|
@@ -390,7 +390,7 @@ export class Vector2d extends XY {
|
|
|
390
390
|
}
|
|
391
391
|
/** Return a unit vector in direction of this instance (undefined if this instance has near zero length) */
|
|
392
392
|
normalize(result) {
|
|
393
|
-
const mag = Geometry.
|
|
393
|
+
const mag = Geometry.correctSmallFraction(this.magnitude());
|
|
394
394
|
result = result ? result : new Vector2d();
|
|
395
395
|
return this.safeDivideOrNull(mag, result);
|
|
396
396
|
}
|
|
@@ -535,7 +535,7 @@ export class Vector2d extends XY {
|
|
|
535
535
|
}
|
|
536
536
|
/** Return a vector parallel to this but with specified length */
|
|
537
537
|
scaleToLength(length, result) {
|
|
538
|
-
const mag = Geometry.
|
|
538
|
+
const mag = Geometry.correctSmallFraction(this.magnitude());
|
|
539
539
|
if (mag === 0)
|
|
540
540
|
return undefined;
|
|
541
541
|
return this.scale(length / mag, result);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Point2dVector2d.js","sourceRoot":"","sources":["../../../src/geometry3d/Point2dVector2d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,qBAAqB;AACrB,yBAAyB;AAEzB,OAAO,EAAmB,QAAQ,EAAuB,MAAM,aAAa,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC;;;;;;;GAOG;AACH,MAAM,OAAO,EAAE;IAKb,wBAAwB;IACjB,GAAG,CAAC,IAAY,CAAC,EAAE,IAAY,CAAC;QACrC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IACD,+BAA+B;IACxB,OAAO;QACZ,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IACD,YAAsB,IAAY,CAAC,EAAE,IAAY,CAAC;QAChD,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IACD,mCAAmC;IAC5B,OAAO,CAAC,KAAa;QAC1B,IAAI,KAAK,EAAE;YACT,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;YACjB,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;SAClB;aAAM;YACL,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;YACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;SACZ;IACH,CAAC;IACD,8CAA8C;IACvC,MAAM;QACX,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IA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C5C,OAAO,KAAK,GAAG,KAAK,IAAI,gBAAgB,GAAG,EAAE,GAAG,EAAE,CAAC;IACrD,CAAC;IACD;;;;;;;OAOG;IACI,iBAAiB,CACtB,KAAe,EAAE,mCAA4C,KAAK,EAAE,OAA6B;QAEjG,MAAM,gBAAgB,GAAW,OAAO,EAAE,gBAAgB,IAAI,QAAQ,CAAC,wBAAwB,CAAC;QAChG,MAAM,kBAAkB,GAAW,OAAO,EAAE,kBAAkB,IAAI,QAAQ,CAAC,0BAA0B,CAAC;QACtG,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACnC,MAAM,EAAE,GAAG,KAAK,CAAC,gBAAgB,EAAE,CAAC;QACpC,IAAI,EAAE,GAAG,kBAAkB,IAAI,EAAE,GAAG,kBAAkB;YACpD,OAAO,gCAAgC,CAAC;QAC1C,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAClC,OAAO,EAAE,GAAG,EAAE,IAAI,gBAAgB,GAAG,EAAE,GAAG,EAAE,CAAC;IAC/C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n// cspell:word JSONXY\r\n// cspell:word CWXY CCWXY\r\n\r\nimport { BeJSONFunctions, Geometry, PerpParallelOptions } from \"../Geometry\";\r\nimport { Angle } from \"./Angle\";\r\nimport { XAndY, XYProps } from \"./XYZProps\";\r\n\r\n/**\r\n * Minimal object containing x,y and operations that are meaningful without change in both point and vector.\r\n * * `XY` is not instantiable.\r\n * * The derived (instantiable) classes are\r\n * * `Point2d`\r\n * * `Vector2d`\r\n * @public\r\n */\r\nexport class XY implements XAndY {\r\n /** x component */\r\n public x: number;\r\n /** y component */\r\n public y: number;\r\n /** Set both x and y. */\r\n public set(x: number = 0, y: number = 0) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n /** Set both x and y to zero */\r\n public setZero() {\r\n this.x = 0;\r\n this.y = 0;\r\n }\r\n protected constructor(x: number = 0, y: number = 0) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n /** Set both x and y from other. */\r\n public setFrom(other?: XAndY) {\r\n if (other) {\r\n this.x = other.x;\r\n this.y = other.y;\r\n } else {\r\n this.x = 0;\r\n this.y = 0;\r\n }\r\n }\r\n /** Freeze this instance so it is read-only */\r\n public freeze(): Readonly<this> {\r\n return Object.freeze(this);\r\n }\r\n /** Returns true if this and other have equal x,y parts within Geometry.smallMetricDistance. */\r\n public isAlmostEqual(other: XAndY, tol?: number): boolean {\r\n return Geometry.isSameCoordinate(this.x, other.x, tol) && Geometry.isSameCoordinate(this.y, other.y, tol);\r\n }\r\n /** Returns true if this and other have equal x,y parts within Geometry.smallMetricDistance. */\r\n public isAlmostEqualXY(x: number, y: number, tol?: number): boolean {\r\n return Geometry.isSameCoordinate(this.x, x, tol) && Geometry.isSameCoordinate(this.y, y, tol);\r\n }\r\n /** Return a json array `[x,y]` */\r\n public toJSON(): XYProps {\r\n return [this.x, this.y];\r\n }\r\n /** Return a json object `{x: 1, y:2}` */\r\n public toJSONXY(): XYProps {\r\n return { x: this.x, y: this.y };\r\n }\r\n /**\r\n * Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`\r\n * * If no JSON input is provided, 0 would be used as default values for x and y.\r\n * @param json the JSON input\r\n */\r\n public setFromJSON(json?: XYProps): void {\r\n if (Array.isArray(json)) {\r\n this.set(json[0] || 0, json[1] || 0);\r\n return;\r\n }\r\n if (json) {\r\n this.set(json.x || 0, json.y || 0);\r\n return;\r\n }\r\n this.set(0, 0);\r\n }\r\n /** Return the distance from this point to other */\r\n public distance(other: XAndY): number {\r\n const xDist = other.x - this.x;\r\n const yDist = other.y - this.y;\r\n return Math.sqrt(xDist * xDist + yDist * yDist);\r\n }\r\n /** Return squared distance from this point to other */\r\n public distanceSquared(other: XAndY): number {\r\n const xDist = other.x - this.x;\r\n const yDist = other.y - this.y;\r\n return xDist * xDist + yDist * yDist;\r\n }\r\n /** Return the largest absolute distance between corresponding components */\r\n public maxDiff(other: XAndY): number {\r\n return Math.max(Math.abs(this.x - other.x), Math.abs(this.y - other.y));\r\n }\r\n /** Return the x,y component corresponding to 0,1 */\r\n public at(index: number): number {\r\n if (index < 0.5)\r\n return this.x;\r\n return this.y;\r\n }\r\n /** Set value at index 0 or 1 */\r\n public setAt(index: number, value: number): void {\r\n if (index < 0.5)\r\n this.x = value;\r\n else\r\n this.y = value;\r\n }\r\n /** Return the index (0,1) of the x,y component with largest absolute value */\r\n public indexOfMaxAbs(): number {\r\n let index = 0;\r\n const a = Math.abs(this.x);\r\n const b = Math.abs(this.y);\r\n if (b > a) {\r\n index = 1;\r\n }\r\n return index;\r\n }\r\n /** Returns true if the x,y components are both small by metric metric tolerance */\r\n public get isAlmostZero(): boolean {\r\n return Geometry.isSmallMetricDistance(this.x) && Geometry.isSmallMetricDistance(this.y);\r\n }\r\n /** Return the largest absolute value of any component */\r\n public maxAbs(): number {\r\n return Math.max(Math.abs(this.x), Math.abs(this.y));\r\n }\r\n /** Return the magnitude of the vector */\r\n public magnitude(): number {\r\n return Math.sqrt(this.x * this.x + this.y * this.y);\r\n }\r\n /** Return the squared magnitude of the vector. */\r\n public magnitudeSquared(): number {\r\n return this.x * this.x + this.y * this.y;\r\n }\r\n /** Returns true if the x,y components are exactly equal. */\r\n public isExactEqual(other: XAndY): boolean {\r\n return this.x === other.x && this.y === other.y;\r\n }\r\n /** Returns true if x,y match `other` within metric tolerance */\r\n public isAlmostEqualMetric(other: XAndY, distanceTol: number = Geometry.smallMetricDistance): boolean {\r\n return this.maxDiff(other) <= distanceTol;\r\n }\r\n /** Return a (full length) vector from this point to other */\r\n public vectorTo(other: XAndY, result?: Vector2d): Vector2d {\r\n return Vector2d.create(\r\n other.x - this.x,\r\n other.y - this.y,\r\n result);\r\n }\r\n /** Return a unit vector from this point to other */\r\n public unitVectorTo(other: XAndY, result?: Vector2d): Vector2d | undefined {\r\n return this.vectorTo(other, result).normalize(result);\r\n }\r\n /** Cross product of vectors from origin to targets */\r\n public static crossProductToPoints(origin: XAndY, targetA: XAndY, targetB: XAndY): number {\r\n return Geometry.crossProductXYXY(\r\n targetA.x - origin.x, targetA.y - origin.y, targetB.x - origin.x, targetB.y - origin.y);\r\n }\r\n}\r\n\r\n/** 2D point with `x`,`y` as properties\r\n * @public\r\n */\r\nexport class Point2d extends XY implements BeJSONFunctions {\r\n /** Constructor for Point2d */\r\n constructor(x: number = 0, y: number = 0) {\r\n super(x, y);\r\n }\r\n /** Return a new Point2d with x,y coordinates from this. */\r\n public clone(result?: Point2d): Point2d {\r\n return Point2d.create(this.x, this.y, result);\r\n }\r\n /**\r\n * Return a point (newly created unless result provided) with given x,y coordinates\r\n * @param x x coordinate\r\n * @param y y coordinate\r\n * @param result optional result\r\n */\r\n public static create(x: number = 0, y: number = 0, result?: Point2d): Point2d {\r\n if (result) {\r\n result.x = x;\r\n result.y = y;\r\n return result;\r\n }\r\n return new Point2d(x, y);\r\n }\r\n /**\r\n * Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`\r\n * * If no JSON input is provided, 0 would be used as default values for x and y.\r\n * @param json the JSON input\r\n */\r\n public static fromJSON(json?: XYProps): Point2d {\r\n const val = new Point2d();\r\n val.setFromJSON(json);\r\n return val;\r\n }\r\n /** Create (or optionally reuse) a Point2d from another object with fields x and y */\r\n public static createFrom(xy: XAndY | undefined, result?: Point2d): Point2d {\r\n if (xy)\r\n return Point2d.create(xy.x, xy.y, result);\r\n return Point2d.create(0, 0, result);\r\n }\r\n /** Create a Point2d with both coordinates zero. */\r\n public static createZero(result?: Point2d): Point2d {\r\n return Point2d.create(0, 0, result);\r\n }\r\n /**\r\n * Starting at this point, move along vector by tangentFraction of the vector length, and then\r\n * to the left by leftFraction of the perpendicular vector length.\r\n * @param tangentFraction distance to move along the vector, as a fraction of vector\r\n * @param leftFraction distance to move perpendicular to the vector, as a fraction of the rotated vector\r\n * @param vector the other vector\r\n */\r\n public addForwardLeft(tangentFraction: number, leftFraction: number, vector: Vector2d): Point2d {\r\n const dx = vector.x;\r\n const dy = vector.y;\r\n return Point2d.create(\r\n this.x + tangentFraction * dx - leftFraction * dy,\r\n this.y + tangentFraction * dy + leftFraction * dx\r\n );\r\n }\r\n /**\r\n * Interpolate at tangentFraction between this instance and point, and then Move by leftFraction\r\n * along the xy perpendicular of the vector between the points.\r\n */\r\n public forwardLeftInterpolate(tangentFraction: number, leftFraction: number, point: XAndY): Point2d {\r\n const dx = point.x - this.x;\r\n const dy = point.y - this.y;\r\n return Point2d.create(\r\n this.x + tangentFraction * dx - leftFraction * dy,\r\n this.y + tangentFraction * dy + leftFraction * dx\r\n );\r\n }\r\n /** Return a point interpolated between this point and the right param. */\r\n public interpolate(fraction: number, other: XAndY, result?: Point2d): Point2d {\r\n if (fraction <= 0.5)\r\n return Point2d.create(\r\n this.x + fraction * (other.x - this.x),\r\n this.y + fraction * (other.y - this.y),\r\n result\r\n );\r\n const t: number = fraction - 1.0;\r\n return Point2d.create(\r\n other.x + t * (other.x - this.x),\r\n other.y + t * (other.y - this.y),\r\n result\r\n );\r\n }\r\n /** Return a point with independent x,y fractional interpolation. */\r\n public interpolateXY(fractionX: number, fractionY: number, other: XAndY, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n Geometry.interpolate(this.x, fractionX, other.x),\r\n Geometry.interpolate(this.y, fractionY, other.y),\r\n result\r\n );\r\n }\r\n /** Return this point minus vector */\r\n public minus(vector: XAndY, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x - vector.x,\r\n this.y - vector.y,\r\n result\r\n );\r\n }\r\n /** Return point plus vector */\r\n public plus(vector: XAndY, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x + vector.x,\r\n this.y + vector.y,\r\n result\r\n );\r\n }\r\n /** Return point plus vector */\r\n public plusXY(dx: number = 0, dy: number = 0, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x + dx,\r\n this.y + dy, result\r\n );\r\n }\r\n /** Return point + vector * scalar */\r\n public plusScaled(vector: XAndY, scaleFactor: number, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x + vector.x * scaleFactor,\r\n this.y + vector.y * scaleFactor,\r\n result\r\n );\r\n }\r\n /** Return point + vectorA * scalarA + vectorB * scalarB */\r\n public plus2Scaled(vectorA: XAndY, scalarA: number, vectorB: XAndY, scalarB: number, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x + vectorA.x * scalarA + vectorB.x * scalarB,\r\n this.y + vectorA.y * scalarA + vectorB.y * scalarB,\r\n result\r\n );\r\n }\r\n /** Return point + vectorA * scalarA + vectorB * scalarB + vectorC * scalarC */\r\n public plus3Scaled(vectorA: XAndY, scalarA: number, vectorB: XAndY, scalarB: number,\r\n vectorC: XAndY, scalarC: number, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x + vectorA.x * scalarA + vectorB.x * scalarB + vectorC.x * scalarC,\r\n this.y + vectorA.y * scalarA + vectorB.y * scalarB + vectorC.y * scalarC,\r\n result\r\n );\r\n }\r\n /**\r\n * Return the dot product of vector from this to targetA and vector from this to targetB\r\n * @param targetA target of first vector\r\n * @param targetB target of second vector\r\n */\r\n public dotVectorsToTargets(targetA: XAndY, targetB: XAndY): number {\r\n return (targetA.x - this.x) * (targetB.x - this.x) + (targetA.y - this.y) * (targetB.y - this.y);\r\n }\r\n /**\r\n * Returns the (scalar) cross product of vector from this to targetA and vector from this to targetB\r\n * @param target1 target of first vector\r\n * @param target2 target of second vector\r\n */\r\n public crossProductToPoints(target1: XAndY, target2: XAndY): number {\r\n const x1 = target1.x - this.x;\r\n const y1 = target1.y - this.y;\r\n const x2 = target2.x - this.x;\r\n const y2 = target2.y - this.y;\r\n return x1 * y2 - y1 * x2;\r\n }\r\n /**\r\n * Return the fractional coordinate of the projection of this instance x,y onto the\r\n * line from startPoint to endPoint.\r\n * @param startPoint start point of line\r\n * @param endPoint end point of line\r\n * @param defaultFraction fraction to return if startPoint and endPoint are equal.\r\n */\r\n public fractionOfProjectionToLine(startPoint: Point2d, endPoint: Point2d, defaultFraction: number = 0): number {\r\n const denominator = startPoint.distanceSquared(endPoint);\r\n if (denominator < Geometry.smallMetricDistanceSquared)\r\n return defaultFraction;\r\n const numerator = startPoint.dotVectorsToTargets(endPoint, this);\r\n return numerator / denominator;\r\n }\r\n}\r\n\r\n/**\r\n * 2D vector with `x`,`y` as properties\r\n * @public\r\n */\r\nexport class Vector2d extends XY implements BeJSONFunctions {\r\n constructor(x: number = 0, y: number = 0) {\r\n super(x, y);\r\n }\r\n /** Return a new Vector2d with the same x,y */\r\n public clone(result?: Vector2d): Vector2d {\r\n return Vector2d.create(this.x, this.y, result);\r\n }\r\n /** Return a new Vector2d with given x and y */\r\n public static create(x: number = 0, y: number = 0, result?: Vector2d): Vector2d {\r\n if (result) {\r\n result.x = x;\r\n result.y = y;\r\n return result;\r\n }\r\n return new Vector2d(x, y);\r\n }\r\n /**\r\n * Return a (new) Vector2d with components scale,0\r\n * If scale is not given default value 1 is used.\r\n */\r\n public static unitX(scale: number = 1): Vector2d {\r\n return new Vector2d(scale, 0);\r\n }\r\n /**\r\n * Return a (new) Vector2d with components 0,scale\r\n * If scale is not given default value 1 is used.\r\n */\r\n public static unitY(scale: number = 1): Vector2d {\r\n return new Vector2d(0, scale);\r\n }\r\n /** Return a Vector2d with components 0,0 */\r\n public static createZero(result?: Vector2d): Vector2d {\r\n return Vector2d.create(0, 0, result);\r\n }\r\n /** Copy contents from another Point3d, Point2d, Vector2d, or Vector3d, or leading entries of Float64Array */\r\n public static createFrom(data: XAndY | Float64Array, result?: Vector2d): Vector2d {\r\n if (data instanceof Float64Array) {\r\n if (data.length >= 2)\r\n return Vector2d.create(data[0], data[1]);\r\n if (data.length >= 1)\r\n return Vector2d.create(data[0], 0);\r\n return Vector2d.create(0, 0);\r\n }\r\n return Vector2d.create(data.x, data.y, result);\r\n }\r\n /**\r\n * Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`\r\n * * If no JSON input is provided, 0 would be used as default values for x and y.\r\n * @param json the JSON input\r\n */\r\n public static fromJSON(json?: XYProps): Vector2d {\r\n const val = new Vector2d();\r\n val.setFromJSON(json);\r\n return val;\r\n }\r\n /** Return a new Vector2d from polar coordinates for radius and Angle from x axis */\r\n public static createPolar(r: number, theta: Angle): Vector2d {\r\n return Vector2d.create(r * theta.cos(), r * theta.sin());\r\n }\r\n /** Return a new Vector2d extending from point0 to point1 */\r\n public static createStartEnd(point0: XAndY, point1: XAndY, result?: Vector2d): Vector2d {\r\n return Vector2d.create(point1.x - point0.x, point1.y - point0.y, result);\r\n }\r\n /**\r\n * Return a vector that bisects the angle between two normals and extends to the intersection of two offset lines\r\n * * returns `undefined` if `unitPerpA = -unitPerpB` (i.e., are opposite)\r\n * * math details can be found at docs/learning/geometry/PointVector.md\r\n * @param unitPerpA unit perpendicular to incoming direction\r\n * @param unitPerpB unit perpendicular to outgoing direction\r\n * @param offset offset distance\r\n */\r\n public static createOffsetBisector(unitPerpA: Vector2d, unitPerpB: Vector2d, offset: number): Vector2d | undefined {\r\n let bisector: Vector2d | undefined = unitPerpA.plus(unitPerpB);\r\n bisector = bisector.normalize();\r\n if (bisector) {\r\n const c = bisector.dotProduct(unitPerpA);\r\n bisector.scale(offset, bisector);\r\n return bisector.safeDivideOrNull(c);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Return a (new or optionally reused) vector which is `this` divided by `denominator`\r\n * * return undefined if denominator is zero.\r\n */\r\n public safeDivideOrNull(denominator: number, result?: Vector2d): Vector2d | undefined {\r\n if (denominator !== 0.0) {\r\n return this.scale(1.0 / denominator, result);\r\n }\r\n return undefined;\r\n }\r\n /** Return a unit vector in direction of this instance (undefined if this instance has near zero length) */\r\n public normalize(result?: Vector2d): Vector2d | undefined {\r\n const mag = Geometry.correctSmallMetricDistance(this.magnitude());\r\n result = result ? result : new Vector2d();\r\n return this.safeDivideOrNull(mag, result);\r\n }\r\n /**\r\n * Return fractional projection of target vector onto this\r\n * * It's returning the signed projection magnitude divided by the target magnitude. In other words,\r\n * it's returning the length of the projection as a fraction of the target magnitude.\r\n * @param target the target vector\r\n * @param defaultFraction the returned value in case magnitude square of target vector is very small\r\n */\r\n public fractionOfProjectionToVector(target: Vector2d, defaultFraction?: number): number {\r\n /*\r\n * projection length is (this.target)/||target||\r\n * but here we return (this.target)/||target||^2\r\n */\r\n const denominator = target.magnitudeSquared();\r\n if (denominator < Geometry.smallMetricDistanceSquared)\r\n return defaultFraction ? defaultFraction : 0;\r\n const numerator = this.dotProduct(target);\r\n return numerator / denominator;\r\n }\r\n /** Return a new vector with components negated from this instance. */\r\n public negate(result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = -this.x;\r\n result.y = -this.y;\r\n return result;\r\n }\r\n /** Return a vector same length as this but rotated 90 degrees counter clockwise */\r\n public rotate90CCWXY(result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n // save x,y to allow aliasing (\"this\" can be passed to the function as \"result\")\r\n const xx: number = this.x;\r\n const yy: number = this.y;\r\n result.x = -yy;\r\n result.y = xx;\r\n return result;\r\n }\r\n /** Return a vector same length as this but rotated 90 degrees clockwise */\r\n public rotate90CWXY(result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n // save x,y to allow aliasing (\"this\" can be passed to the function as \"result\")\r\n const xx: number = this.x;\r\n const yy: number = this.y;\r\n result.x = yy;\r\n result.y = -xx;\r\n return result;\r\n }\r\n /** Return a unit vector perpendicular to this instance. */\r\n public unitPerpendicularXY(result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n const xx: number = this.x;\r\n const yy: number = this.y;\r\n // save x,y to allow aliasing (\"this\" can be passed to the function as \"result\")\r\n result.x = -yy;\r\n result.y = xx;\r\n const d2: number = xx * xx + yy * yy;\r\n if (d2 !== 0.0) {\r\n const a = 1.0 / Math.sqrt(d2);\r\n result.x *= a;\r\n result.y *= a;\r\n }\r\n return result;\r\n }\r\n /** Return a new Vector2d rotated CCW by given angle */\r\n public rotateXY(angle: Angle, result?: Vector2d): Vector2d {\r\n const s = angle.sin();\r\n const c = angle.cos();\r\n // save x,y to allow aliasing (\"this\" can be passed to the function as \"result\")\r\n const xx: number = this.x;\r\n const yy: number = this.y;\r\n result = result ? result : new Vector2d();\r\n result.x = xx * c - yy * s;\r\n result.y = xx * s + yy * c;\r\n return result;\r\n }\r\n /**\r\n * Return a vector computed at fractional position between this vector and vectorB\r\n * @param fraction fractional position. 0 is at `this`. 1 is at `vectorB`.\r\n * True fractions are \"between\", negatives are \"before this\", beyond 1 is \"beyond vectorB\".\r\n * @param vectorB second vector\r\n * @param result optional preallocated result.\r\n */\r\n public interpolate(fraction: number, vectorB: Vector2d, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n /*\r\n * For best last-bit behavior, if fraction is below 0.5, use this as base point.\r\n * If above 0.5, use vectorB as base point.\r\n */\r\n if (fraction <= 0.5) {\r\n result.x = this.x + fraction * (vectorB.x - this.x);\r\n result.y = this.y + fraction * (vectorB.y - this.y);\r\n } else {\r\n const t: number = fraction - 1.0;\r\n result.x = vectorB.x + t * (vectorB.x - this.x);\r\n result.y = vectorB.y + t * (vectorB.y - this.y);\r\n }\r\n return result;\r\n }\r\n /** Return {this + vector}. */\r\n public plus(vector: XAndY, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x + vector.x;\r\n result.y = this.y + vector.y;\r\n return result;\r\n }\r\n /** Return {this - vector}. */\r\n public minus(vector: XAndY, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x - vector.x;\r\n result.y = this.y - vector.y;\r\n return result;\r\n }\r\n /** Return {point + vector \\* scalar} */\r\n public plusScaled(vector: XAndY, scaleFactor: number, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x + vector.x * scaleFactor;\r\n result.y = this.y + vector.y * scaleFactor;\r\n return result;\r\n }\r\n /** Return {point + vectorA \\* scalarA + vectorB \\* scalarB} */\r\n public plus2Scaled(vectorA: XAndY, scalarA: number, vectorB: XAndY, scalarB: number, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x + vectorA.x * scalarA + vectorB.x * scalarB;\r\n result.y = this.y + vectorA.y * scalarA + vectorB.y * scalarB;\r\n return result;\r\n }\r\n /** Return {this + vectorA \\* scalarA + vectorB \\* scalarB + vectorC \\* scalarC} */\r\n public plus3Scaled(vectorA: XAndY, scalarA: number, vectorB: XAndY, scalarB: number, vectorC: XAndY, scalarC: number, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x + vectorA.x * scalarA + vectorB.x * scalarB + vectorC.x * scalarC;\r\n result.y = this.y + vectorA.y * scalarA + vectorB.y * scalarB + vectorC.y * scalarC;\r\n return result;\r\n }\r\n /** Return {this * scale} */\r\n public scale(scale: number, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x * scale;\r\n result.y = this.y * scale;\r\n return result;\r\n }\r\n /** Return a vector parallel to this but with specified length */\r\n public scaleToLength(length: number, result?: Vector2d): Vector2d | undefined {\r\n const mag = Geometry.correctSmallMetricDistance(this.magnitude());\r\n if (mag === 0)\r\n return undefined;\r\n return this.scale(length / mag, result);\r\n }\r\n /** Return the dot product of this with vectorB */\r\n public dotProduct(vectorB: XAndY): number {\r\n return this.x * vectorB.x + this.y * vectorB.y;\r\n }\r\n /** Dot product with vector from pointA to pointB */\r\n public dotProductStartEnd(pointA: XAndY, pointB: XAndY): number {\r\n return this.x * (pointB.x - pointA.x) + this.y * (pointB.y - pointA.y);\r\n }\r\n /** Vector cross product {this CROSS vectorB} */\r\n public crossProduct(vectorB: XAndY): number {\r\n return this.x * vectorB.y - this.y * vectorB.x;\r\n }\r\n /**\r\n * Return the radians (as a simple number, not strongly typed Angle) signed angle from this to vectorB.\r\n * This is positive if the shortest turn is counterclockwise, negative if clockwise.\r\n */\r\n public radiansTo(vectorB: XAndY): number {\r\n return Math.atan2(this.crossProduct(vectorB), this.dotProduct(vectorB));\r\n }\r\n /**\r\n * Return the (strongly typed) signed angle from this to vectorB.\r\n * This is positive if the shortest turn is counterclockwise, negative if clockwise.\r\n */\r\n public angleTo(vectorB: XAndY): Angle {\r\n return Angle.createRadians(this.radiansTo(vectorB));\r\n }\r\n /**\r\n * Test if this vector is parallel to other.\r\n * * The input tolerances in `options`, if given, are considered to be squared for efficiency's sake,\r\n * so if you have a distance or angle tolerance t, you should pass in t * t.\r\n * @param other second vector for comparison.\r\n * @param oppositeIsParallel whether to consider diametrically opposed vectors as parallel.\r\n * @param options optional radian and distance tolerances.\r\n */\r\n public isParallelTo(other: Vector2d, oppositeIsParallel: boolean = false,\r\n returnValueIfAnInputIsZeroLength: boolean = false, options?: PerpParallelOptions): boolean {\r\n const radianSquaredTol: number = options?.radianSquaredTol ?? Geometry.smallAngleRadiansSquared;\r\n const distanceSquaredTol: number = options?.distanceSquaredTol ?? Geometry.smallMetricDistanceSquared;\r\n const a2 = this.magnitudeSquared();\r\n const b2 = other.magnitudeSquared();\r\n if (a2 < distanceSquaredTol || b2 < distanceSquaredTol)\r\n return returnValueIfAnInputIsZeroLength;\r\n const dot = this.dotProduct(other);\r\n if (dot < 0.0 && !oppositeIsParallel)\r\n return false;\r\n const cross = this.crossProduct(other);\r\n /* a2,b2,cross2 are squared lengths of respective vectors */\r\n /* cross2 = sin^2(theta) * a2 * b2 */\r\n /* For small theta, sin^2(theta)~~theta^2 */\r\n return cross * cross <= radianSquaredTol * a2 * b2;\r\n }\r\n /**\r\n * Test if this vector is perpendicular to other.\r\n * * The input tolerances in `options`, if given, are considered to be squared for efficiency's sake,\r\n * so if you have a distance or angle tolerance t, you should pass in t * t.\r\n * @param other second vector in comparison.\r\n * @param returnValueIfAnInputIsZeroLength if either vector is near zero length, return this value.\r\n * @param options optional radian and distance tolerances.\r\n */\r\n public isPerpendicularTo(\r\n other: Vector2d, returnValueIfAnInputIsZeroLength: boolean = false, options?: PerpParallelOptions\r\n ): boolean {\r\n const radianSquaredTol: number = options?.radianSquaredTol ?? Geometry.smallAngleRadiansSquared;\r\n const distanceSquaredTol: number = options?.distanceSquaredTol ?? Geometry.smallMetricDistanceSquared;\r\n const aa = this.magnitudeSquared();\r\n const bb = other.magnitudeSquared();\r\n if (aa < distanceSquaredTol || bb < distanceSquaredTol)\r\n return returnValueIfAnInputIsZeroLength;\r\n const ab = this.dotProduct(other);\r\n return ab * ab <= radianSquaredTol * aa * bb;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Point2dVector2d.js","sourceRoot":"","sources":["../../../src/geometry3d/Point2dVector2d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,qBAAqB;AACrB,yBAAyB;AAEzB,OAAO,EAAmB,QAAQ,EAAuB,MAAM,aAAa,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC;;;;;;;GAOG;AACH,MAAM,OAAO,EAAE;IAKb,wBAAwB;IACjB,GAAG,CAAC,IAAY,CAAC,EAAE,IAAY,CAAC;QACrC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IACD,+BAA+B;IACxB,OAAO;QACZ,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IACD,YAAsB,IAAY,CAAC,EAAE,IAAY,CAAC;QAChD,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IACD,mCAAmC;IAC5B,OAAO,CAAC,KAAa;QAC1B,IAAI,KAAK,EAAE;YACT,IA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AAG,kBAAkB;YACpD,OAAO,gCAAgC,CAAC;QAC1C,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACnC,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,kBAAkB;YAClC,OAAO,KAAK,CAAC;QACf,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QACvC,4DAA4D;QAC5D,qCAAqC;QACrC,4CAA4C;QAC5C,OAAO,KAAK,GAAG,KAAK,IAAI,gBAAgB,GAAG,EAAE,GAAG,EAAE,CAAC;IACrD,CAAC;IACD;;;;;;;OAOG;IACI,iBAAiB,CACtB,KAAe,EAAE,mCAA4C,KAAK,EAAE,OAA6B;QAEjG,MAAM,gBAAgB,GAAW,OAAO,EAAE,gBAAgB,IAAI,QAAQ,CAAC,wBAAwB,CAAC;QAChG,MAAM,kBAAkB,GAAW,OAAO,EAAE,kBAAkB,IAAI,QAAQ,CAAC,0BAA0B,CAAC;QACtG,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACnC,MAAM,EAAE,GAAG,KAAK,CAAC,gBAAgB,EAAE,CAAC;QACpC,IAAI,EAAE,GAAG,kBAAkB,IAAI,EAAE,GAAG,kBAAkB;YACpD,OAAO,gCAAgC,CAAC;QAC1C,MAAM,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAClC,OAAO,EAAE,GAAG,EAAE,IAAI,gBAAgB,GAAG,EAAE,GAAG,EAAE,CAAC;IAC/C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n// cspell:word JSONXY\r\n// cspell:word CWXY CCWXY\r\n\r\nimport { BeJSONFunctions, Geometry, PerpParallelOptions } from \"../Geometry\";\r\nimport { Angle } from \"./Angle\";\r\nimport { XAndY, XYProps } from \"./XYZProps\";\r\n\r\n/**\r\n * Minimal object containing x,y and operations that are meaningful without change in both point and vector.\r\n * * `XY` is not instantiable.\r\n * * The derived (instantiable) classes are\r\n * * `Point2d`\r\n * * `Vector2d`\r\n * @public\r\n */\r\nexport class XY implements XAndY {\r\n /** x component */\r\n public x: number;\r\n /** y component */\r\n public y: number;\r\n /** Set both x and y. */\r\n public set(x: number = 0, y: number = 0) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n /** Set both x and y to zero */\r\n public setZero() {\r\n this.x = 0;\r\n this.y = 0;\r\n }\r\n protected constructor(x: number = 0, y: number = 0) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n /** Set both x and y from other. */\r\n public setFrom(other?: XAndY) {\r\n if (other) {\r\n this.x = other.x;\r\n this.y = other.y;\r\n } else {\r\n this.x = 0;\r\n this.y = 0;\r\n }\r\n }\r\n /** Freeze this instance so it is read-only */\r\n public freeze(): Readonly<this> {\r\n return Object.freeze(this);\r\n }\r\n /** Returns true if this and other have equal x,y parts within Geometry.smallMetricDistance. */\r\n public isAlmostEqual(other: XAndY, tol?: number): boolean {\r\n return Geometry.isSameCoordinate(this.x, other.x, tol) && Geometry.isSameCoordinate(this.y, other.y, tol);\r\n }\r\n /** Returns true if this and other have equal x,y parts within Geometry.smallMetricDistance. */\r\n public isAlmostEqualXY(x: number, y: number, tol?: number): boolean {\r\n return Geometry.isSameCoordinate(this.x, x, tol) && Geometry.isSameCoordinate(this.y, y, tol);\r\n }\r\n /** Return a json array `[x,y]` */\r\n public toJSON(): XYProps {\r\n return [this.x, this.y];\r\n }\r\n /** Return a json object `{x: 1, y:2}` */\r\n public toJSONXY(): XYProps {\r\n return { x: this.x, y: this.y };\r\n }\r\n /**\r\n * Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`\r\n * * If no JSON input is provided, 0 would be used as default values for x and y.\r\n * @param json the JSON input\r\n */\r\n public setFromJSON(json?: XYProps): void {\r\n if (Array.isArray(json)) {\r\n this.set(json[0] || 0, json[1] || 0);\r\n return;\r\n }\r\n if (json) {\r\n this.set(json.x || 0, json.y || 0);\r\n return;\r\n }\r\n this.set(0, 0);\r\n }\r\n /** Return the distance from this point to other */\r\n public distance(other: XAndY): number {\r\n const xDist = other.x - this.x;\r\n const yDist = other.y - this.y;\r\n return Math.sqrt(xDist * xDist + yDist * yDist);\r\n }\r\n /** Return squared distance from this point to other */\r\n public distanceSquared(other: XAndY): number {\r\n const xDist = other.x - this.x;\r\n const yDist = other.y - this.y;\r\n return xDist * xDist + yDist * yDist;\r\n }\r\n /** Return the largest absolute distance between corresponding components */\r\n public maxDiff(other: XAndY): number {\r\n return Math.max(Math.abs(this.x - other.x), Math.abs(this.y - other.y));\r\n }\r\n /** Return the x,y component corresponding to 0,1 */\r\n public at(index: number): number {\r\n if (index < 0.5)\r\n return this.x;\r\n return this.y;\r\n }\r\n /** Set value at index 0 or 1 */\r\n public setAt(index: number, value: number): void {\r\n if (index < 0.5)\r\n this.x = value;\r\n else\r\n this.y = value;\r\n }\r\n /** Return the index (0,1) of the x,y component with largest absolute value */\r\n public indexOfMaxAbs(): number {\r\n let index = 0;\r\n const a = Math.abs(this.x);\r\n const b = Math.abs(this.y);\r\n if (b > a) {\r\n index = 1;\r\n }\r\n return index;\r\n }\r\n /** Returns true if the x,y components are both small by metric metric tolerance */\r\n public get isAlmostZero(): boolean {\r\n return Geometry.isSmallMetricDistance(this.x) && Geometry.isSmallMetricDistance(this.y);\r\n }\r\n /** Return the largest absolute value of any component */\r\n public maxAbs(): number {\r\n return Math.max(Math.abs(this.x), Math.abs(this.y));\r\n }\r\n /** Return the magnitude of the vector */\r\n public magnitude(): number {\r\n return Math.sqrt(this.x * this.x + this.y * this.y);\r\n }\r\n /** Return the squared magnitude of the vector. */\r\n public magnitudeSquared(): number {\r\n return this.x * this.x + this.y * this.y;\r\n }\r\n /** Returns true if the x,y components are exactly equal. */\r\n public isExactEqual(other: XAndY): boolean {\r\n return this.x === other.x && this.y === other.y;\r\n }\r\n /** Returns true if x,y match `other` within metric tolerance */\r\n public isAlmostEqualMetric(other: XAndY, distanceTol: number = Geometry.smallMetricDistance): boolean {\r\n return this.maxDiff(other) <= distanceTol;\r\n }\r\n /** Return a (full length) vector from this point to other */\r\n public vectorTo(other: XAndY, result?: Vector2d): Vector2d {\r\n return Vector2d.create(\r\n other.x - this.x,\r\n other.y - this.y,\r\n result);\r\n }\r\n /** Return a unit vector from this point to other */\r\n public unitVectorTo(other: XAndY, result?: Vector2d): Vector2d | undefined {\r\n return this.vectorTo(other, result).normalize(result);\r\n }\r\n /** Cross product of vectors from origin to targets */\r\n public static crossProductToPoints(origin: XAndY, targetA: XAndY, targetB: XAndY): number {\r\n return Geometry.crossProductXYXY(\r\n targetA.x - origin.x, targetA.y - origin.y, targetB.x - origin.x, targetB.y - origin.y);\r\n }\r\n}\r\n\r\n/** 2D point with `x`,`y` as properties\r\n * @public\r\n */\r\nexport class Point2d extends XY implements BeJSONFunctions {\r\n /** Constructor for Point2d */\r\n constructor(x: number = 0, y: number = 0) {\r\n super(x, y);\r\n }\r\n /** Return a new Point2d with x,y coordinates from this. */\r\n public clone(result?: Point2d): Point2d {\r\n return Point2d.create(this.x, this.y, result);\r\n }\r\n /**\r\n * Return a point (newly created unless result provided) with given x,y coordinates\r\n * @param x x coordinate\r\n * @param y y coordinate\r\n * @param result optional result\r\n */\r\n public static create(x: number = 0, y: number = 0, result?: Point2d): Point2d {\r\n if (result) {\r\n result.x = x;\r\n result.y = y;\r\n return result;\r\n }\r\n return new Point2d(x, y);\r\n }\r\n /**\r\n * Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`\r\n * * If no JSON input is provided, 0 would be used as default values for x and y.\r\n * @param json the JSON input\r\n */\r\n public static fromJSON(json?: XYProps): Point2d {\r\n const val = new Point2d();\r\n val.setFromJSON(json);\r\n return val;\r\n }\r\n /** Create (or optionally reuse) a Point2d from another object with fields x and y */\r\n public static createFrom(xy: XAndY | undefined, result?: Point2d): Point2d {\r\n if (xy)\r\n return Point2d.create(xy.x, xy.y, result);\r\n return Point2d.create(0, 0, result);\r\n }\r\n /** Create a Point2d with both coordinates zero. */\r\n public static createZero(result?: Point2d): Point2d {\r\n return Point2d.create(0, 0, result);\r\n }\r\n /**\r\n * Starting at this point, move along vector by tangentFraction of the vector length, and then\r\n * to the left by leftFraction of the perpendicular vector length.\r\n * @param tangentFraction distance to move along the vector, as a fraction of vector\r\n * @param leftFraction distance to move perpendicular to the vector, as a fraction of the rotated vector\r\n * @param vector the other vector\r\n */\r\n public addForwardLeft(tangentFraction: number, leftFraction: number, vector: Vector2d): Point2d {\r\n const dx = vector.x;\r\n const dy = vector.y;\r\n return Point2d.create(\r\n this.x + tangentFraction * dx - leftFraction * dy,\r\n this.y + tangentFraction * dy + leftFraction * dx\r\n );\r\n }\r\n /**\r\n * Interpolate at tangentFraction between this instance and point, and then Move by leftFraction\r\n * along the xy perpendicular of the vector between the points.\r\n */\r\n public forwardLeftInterpolate(tangentFraction: number, leftFraction: number, point: XAndY): Point2d {\r\n const dx = point.x - this.x;\r\n const dy = point.y - this.y;\r\n return Point2d.create(\r\n this.x + tangentFraction * dx - leftFraction * dy,\r\n this.y + tangentFraction * dy + leftFraction * dx\r\n );\r\n }\r\n /** Return a point interpolated between this point and the right param. */\r\n public interpolate(fraction: number, other: XAndY, result?: Point2d): Point2d {\r\n if (fraction <= 0.5)\r\n return Point2d.create(\r\n this.x + fraction * (other.x - this.x),\r\n this.y + fraction * (other.y - this.y),\r\n result\r\n );\r\n const t: number = fraction - 1.0;\r\n return Point2d.create(\r\n other.x + t * (other.x - this.x),\r\n other.y + t * (other.y - this.y),\r\n result\r\n );\r\n }\r\n /** Return a point with independent x,y fractional interpolation. */\r\n public interpolateXY(fractionX: number, fractionY: number, other: XAndY, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n Geometry.interpolate(this.x, fractionX, other.x),\r\n Geometry.interpolate(this.y, fractionY, other.y),\r\n result\r\n );\r\n }\r\n /** Return this point minus vector */\r\n public minus(vector: XAndY, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x - vector.x,\r\n this.y - vector.y,\r\n result\r\n );\r\n }\r\n /** Return point plus vector */\r\n public plus(vector: XAndY, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x + vector.x,\r\n this.y + vector.y,\r\n result\r\n );\r\n }\r\n /** Return point plus vector */\r\n public plusXY(dx: number = 0, dy: number = 0, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x + dx,\r\n this.y + dy, result\r\n );\r\n }\r\n /** Return point + vector * scalar */\r\n public plusScaled(vector: XAndY, scaleFactor: number, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x + vector.x * scaleFactor,\r\n this.y + vector.y * scaleFactor,\r\n result\r\n );\r\n }\r\n /** Return point + vectorA * scalarA + vectorB * scalarB */\r\n public plus2Scaled(vectorA: XAndY, scalarA: number, vectorB: XAndY, scalarB: number, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x + vectorA.x * scalarA + vectorB.x * scalarB,\r\n this.y + vectorA.y * scalarA + vectorB.y * scalarB,\r\n result\r\n );\r\n }\r\n /** Return point + vectorA * scalarA + vectorB * scalarB + vectorC * scalarC */\r\n public plus3Scaled(vectorA: XAndY, scalarA: number, vectorB: XAndY, scalarB: number,\r\n vectorC: XAndY, scalarC: number, result?: Point2d): Point2d {\r\n return Point2d.create(\r\n this.x + vectorA.x * scalarA + vectorB.x * scalarB + vectorC.x * scalarC,\r\n this.y + vectorA.y * scalarA + vectorB.y * scalarB + vectorC.y * scalarC,\r\n result\r\n );\r\n }\r\n /**\r\n * Return the dot product of vector from this to targetA and vector from this to targetB\r\n * @param targetA target of first vector\r\n * @param targetB target of second vector\r\n */\r\n public dotVectorsToTargets(targetA: XAndY, targetB: XAndY): number {\r\n return (targetA.x - this.x) * (targetB.x - this.x) + (targetA.y - this.y) * (targetB.y - this.y);\r\n }\r\n /**\r\n * Returns the (scalar) cross product of vector from this to targetA and vector from this to targetB\r\n * @param target1 target of first vector\r\n * @param target2 target of second vector\r\n */\r\n public crossProductToPoints(target1: XAndY, target2: XAndY): number {\r\n const x1 = target1.x - this.x;\r\n const y1 = target1.y - this.y;\r\n const x2 = target2.x - this.x;\r\n const y2 = target2.y - this.y;\r\n return x1 * y2 - y1 * x2;\r\n }\r\n /**\r\n * Return the fractional coordinate of the projection of this instance x,y onto the\r\n * line from startPoint to endPoint.\r\n * @param startPoint start point of line\r\n * @param endPoint end point of line\r\n * @param defaultFraction fraction to return if startPoint and endPoint are equal.\r\n */\r\n public fractionOfProjectionToLine(startPoint: Point2d, endPoint: Point2d, defaultFraction: number = 0): number {\r\n const denominator = startPoint.distanceSquared(endPoint);\r\n if (denominator < Geometry.smallMetricDistanceSquared)\r\n return defaultFraction;\r\n const numerator = startPoint.dotVectorsToTargets(endPoint, this);\r\n return numerator / denominator;\r\n }\r\n}\r\n\r\n/**\r\n * 2D vector with `x`,`y` as properties\r\n * @public\r\n */\r\nexport class Vector2d extends XY implements BeJSONFunctions {\r\n constructor(x: number = 0, y: number = 0) {\r\n super(x, y);\r\n }\r\n /** Return a new Vector2d with the same x,y */\r\n public clone(result?: Vector2d): Vector2d {\r\n return Vector2d.create(this.x, this.y, result);\r\n }\r\n /** Return a new Vector2d with given x and y */\r\n public static create(x: number = 0, y: number = 0, result?: Vector2d): Vector2d {\r\n if (result) {\r\n result.x = x;\r\n result.y = y;\r\n return result;\r\n }\r\n return new Vector2d(x, y);\r\n }\r\n /**\r\n * Return a (new) Vector2d with components scale,0\r\n * If scale is not given default value 1 is used.\r\n */\r\n public static unitX(scale: number = 1): Vector2d {\r\n return new Vector2d(scale, 0);\r\n }\r\n /**\r\n * Return a (new) Vector2d with components 0,scale\r\n * If scale is not given default value 1 is used.\r\n */\r\n public static unitY(scale: number = 1): Vector2d {\r\n return new Vector2d(0, scale);\r\n }\r\n /** Return a Vector2d with components 0,0 */\r\n public static createZero(result?: Vector2d): Vector2d {\r\n return Vector2d.create(0, 0, result);\r\n }\r\n /** Copy contents from another Point3d, Point2d, Vector2d, or Vector3d, or leading entries of Float64Array */\r\n public static createFrom(data: XAndY | Float64Array, result?: Vector2d): Vector2d {\r\n if (data instanceof Float64Array) {\r\n if (data.length >= 2)\r\n return Vector2d.create(data[0], data[1]);\r\n if (data.length >= 1)\r\n return Vector2d.create(data[0], 0);\r\n return Vector2d.create(0, 0);\r\n }\r\n return Vector2d.create(data.x, data.y, result);\r\n }\r\n /**\r\n * Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`\r\n * * If no JSON input is provided, 0 would be used as default values for x and y.\r\n * @param json the JSON input\r\n */\r\n public static fromJSON(json?: XYProps): Vector2d {\r\n const val = new Vector2d();\r\n val.setFromJSON(json);\r\n return val;\r\n }\r\n /** Return a new Vector2d from polar coordinates for radius and Angle from x axis */\r\n public static createPolar(r: number, theta: Angle): Vector2d {\r\n return Vector2d.create(r * theta.cos(), r * theta.sin());\r\n }\r\n /** Return a new Vector2d extending from point0 to point1 */\r\n public static createStartEnd(point0: XAndY, point1: XAndY, result?: Vector2d): Vector2d {\r\n return Vector2d.create(point1.x - point0.x, point1.y - point0.y, result);\r\n }\r\n /**\r\n * Return a vector that bisects the angle between two normals and extends to the intersection of two offset lines\r\n * * returns `undefined` if `unitPerpA = -unitPerpB` (i.e., are opposite)\r\n * * math details can be found at docs/learning/geometry/PointVector.md\r\n * @param unitPerpA unit perpendicular to incoming direction\r\n * @param unitPerpB unit perpendicular to outgoing direction\r\n * @param offset offset distance\r\n */\r\n public static createOffsetBisector(unitPerpA: Vector2d, unitPerpB: Vector2d, offset: number): Vector2d | undefined {\r\n let bisector: Vector2d | undefined = unitPerpA.plus(unitPerpB);\r\n bisector = bisector.normalize();\r\n if (bisector) {\r\n const c = bisector.dotProduct(unitPerpA);\r\n bisector.scale(offset, bisector);\r\n return bisector.safeDivideOrNull(c);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Return a (new or optionally reused) vector which is `this` divided by `denominator`\r\n * * return undefined if denominator is zero.\r\n */\r\n public safeDivideOrNull(denominator: number, result?: Vector2d): Vector2d | undefined {\r\n if (denominator !== 0.0) {\r\n return this.scale(1.0 / denominator, result);\r\n }\r\n return undefined;\r\n }\r\n /** Return a unit vector in direction of this instance (undefined if this instance has near zero length) */\r\n public normalize(result?: Vector2d): Vector2d | undefined {\r\n const mag = Geometry.correctSmallFraction(this.magnitude());\r\n result = result ? result : new Vector2d();\r\n return this.safeDivideOrNull(mag, result);\r\n }\r\n /**\r\n * Return fractional projection of target vector onto this\r\n * * It's returning the signed projection magnitude divided by the target magnitude. In other words,\r\n * it's returning the length of the projection as a fraction of the target magnitude.\r\n * @param target the target vector\r\n * @param defaultFraction the returned value in case magnitude square of target vector is very small\r\n */\r\n public fractionOfProjectionToVector(target: Vector2d, defaultFraction?: number): number {\r\n /*\r\n * projection length is (this.target)/||target||\r\n * but here we return (this.target)/||target||^2\r\n */\r\n const denominator = target.magnitudeSquared();\r\n if (denominator < Geometry.smallMetricDistanceSquared)\r\n return defaultFraction ? defaultFraction : 0;\r\n const numerator = this.dotProduct(target);\r\n return numerator / denominator;\r\n }\r\n /** Return a new vector with components negated from this instance. */\r\n public negate(result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = -this.x;\r\n result.y = -this.y;\r\n return result;\r\n }\r\n /** Return a vector same length as this but rotated 90 degrees counter clockwise */\r\n public rotate90CCWXY(result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n // save x,y to allow aliasing (\"this\" can be passed to the function as \"result\")\r\n const xx: number = this.x;\r\n const yy: number = this.y;\r\n result.x = -yy;\r\n result.y = xx;\r\n return result;\r\n }\r\n /** Return a vector same length as this but rotated 90 degrees clockwise */\r\n public rotate90CWXY(result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n // save x,y to allow aliasing (\"this\" can be passed to the function as \"result\")\r\n const xx: number = this.x;\r\n const yy: number = this.y;\r\n result.x = yy;\r\n result.y = -xx;\r\n return result;\r\n }\r\n /** Return a unit vector perpendicular to this instance. */\r\n public unitPerpendicularXY(result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n const xx: number = this.x;\r\n const yy: number = this.y;\r\n // save x,y to allow aliasing (\"this\" can be passed to the function as \"result\")\r\n result.x = -yy;\r\n result.y = xx;\r\n const d2: number = xx * xx + yy * yy;\r\n if (d2 !== 0.0) {\r\n const a = 1.0 / Math.sqrt(d2);\r\n result.x *= a;\r\n result.y *= a;\r\n }\r\n return result;\r\n }\r\n /** Return a new Vector2d rotated CCW by given angle */\r\n public rotateXY(angle: Angle, result?: Vector2d): Vector2d {\r\n const s = angle.sin();\r\n const c = angle.cos();\r\n // save x,y to allow aliasing (\"this\" can be passed to the function as \"result\")\r\n const xx: number = this.x;\r\n const yy: number = this.y;\r\n result = result ? result : new Vector2d();\r\n result.x = xx * c - yy * s;\r\n result.y = xx * s + yy * c;\r\n return result;\r\n }\r\n /**\r\n * Return a vector computed at fractional position between this vector and vectorB\r\n * @param fraction fractional position. 0 is at `this`. 1 is at `vectorB`.\r\n * True fractions are \"between\", negatives are \"before this\", beyond 1 is \"beyond vectorB\".\r\n * @param vectorB second vector\r\n * @param result optional preallocated result.\r\n */\r\n public interpolate(fraction: number, vectorB: Vector2d, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n /*\r\n * For best last-bit behavior, if fraction is below 0.5, use this as base point.\r\n * If above 0.5, use vectorB as base point.\r\n */\r\n if (fraction <= 0.5) {\r\n result.x = this.x + fraction * (vectorB.x - this.x);\r\n result.y = this.y + fraction * (vectorB.y - this.y);\r\n } else {\r\n const t: number = fraction - 1.0;\r\n result.x = vectorB.x + t * (vectorB.x - this.x);\r\n result.y = vectorB.y + t * (vectorB.y - this.y);\r\n }\r\n return result;\r\n }\r\n /** Return {this + vector}. */\r\n public plus(vector: XAndY, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x + vector.x;\r\n result.y = this.y + vector.y;\r\n return result;\r\n }\r\n /** Return {this - vector}. */\r\n public minus(vector: XAndY, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x - vector.x;\r\n result.y = this.y - vector.y;\r\n return result;\r\n }\r\n /** Return {point + vector \\* scalar} */\r\n public plusScaled(vector: XAndY, scaleFactor: number, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x + vector.x * scaleFactor;\r\n result.y = this.y + vector.y * scaleFactor;\r\n return result;\r\n }\r\n /** Return {point + vectorA \\* scalarA + vectorB \\* scalarB} */\r\n public plus2Scaled(vectorA: XAndY, scalarA: number, vectorB: XAndY, scalarB: number, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x + vectorA.x * scalarA + vectorB.x * scalarB;\r\n result.y = this.y + vectorA.y * scalarA + vectorB.y * scalarB;\r\n return result;\r\n }\r\n /** Return {this + vectorA \\* scalarA + vectorB \\* scalarB + vectorC \\* scalarC} */\r\n public plus3Scaled(vectorA: XAndY, scalarA: number, vectorB: XAndY, scalarB: number, vectorC: XAndY, scalarC: number, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x + vectorA.x * scalarA + vectorB.x * scalarB + vectorC.x * scalarC;\r\n result.y = this.y + vectorA.y * scalarA + vectorB.y * scalarB + vectorC.y * scalarC;\r\n return result;\r\n }\r\n /** Return {this * scale} */\r\n public scale(scale: number, result?: Vector2d): Vector2d {\r\n result = result ? result : new Vector2d();\r\n result.x = this.x * scale;\r\n result.y = this.y * scale;\r\n return result;\r\n }\r\n /** Return a vector parallel to this but with specified length */\r\n public scaleToLength(length: number, result?: Vector2d): Vector2d | undefined {\r\n const mag = Geometry.correctSmallFraction(this.magnitude());\r\n if (mag === 0)\r\n return undefined;\r\n return this.scale(length / mag, result);\r\n }\r\n /** Return the dot product of this with vectorB */\r\n public dotProduct(vectorB: XAndY): number {\r\n return this.x * vectorB.x + this.y * vectorB.y;\r\n }\r\n /** Dot product with vector from pointA to pointB */\r\n public dotProductStartEnd(pointA: XAndY, pointB: XAndY): number {\r\n return this.x * (pointB.x - pointA.x) + this.y * (pointB.y - pointA.y);\r\n }\r\n /** Vector cross product {this CROSS vectorB} */\r\n public crossProduct(vectorB: XAndY): number {\r\n return this.x * vectorB.y - this.y * vectorB.x;\r\n }\r\n /**\r\n * Return the radians (as a simple number, not strongly typed Angle) signed angle from this to vectorB.\r\n * This is positive if the shortest turn is counterclockwise, negative if clockwise.\r\n */\r\n public radiansTo(vectorB: XAndY): number {\r\n return Math.atan2(this.crossProduct(vectorB), this.dotProduct(vectorB));\r\n }\r\n /**\r\n * Return the (strongly typed) signed angle from this to vectorB.\r\n * This is positive if the shortest turn is counterclockwise, negative if clockwise.\r\n */\r\n public angleTo(vectorB: XAndY): Angle {\r\n return Angle.createRadians(this.radiansTo(vectorB));\r\n }\r\n /**\r\n * Test if this vector is parallel to other.\r\n * * The input tolerances in `options`, if given, are considered to be squared for efficiency's sake,\r\n * so if you have a distance or angle tolerance t, you should pass in t * t.\r\n * @param other second vector for comparison.\r\n * @param oppositeIsParallel whether to consider diametrically opposed vectors as parallel.\r\n * @param options optional radian and distance tolerances.\r\n */\r\n public isParallelTo(other: Vector2d, oppositeIsParallel: boolean = false,\r\n returnValueIfAnInputIsZeroLength: boolean = false, options?: PerpParallelOptions): boolean {\r\n const radianSquaredTol: number = options?.radianSquaredTol ?? Geometry.smallAngleRadiansSquared;\r\n const distanceSquaredTol: number = options?.distanceSquaredTol ?? Geometry.smallMetricDistanceSquared;\r\n const a2 = this.magnitudeSquared();\r\n const b2 = other.magnitudeSquared();\r\n if (a2 < distanceSquaredTol || b2 < distanceSquaredTol)\r\n return returnValueIfAnInputIsZeroLength;\r\n const dot = this.dotProduct(other);\r\n if (dot < 0.0 && !oppositeIsParallel)\r\n return false;\r\n const cross = this.crossProduct(other);\r\n /* a2,b2,cross2 are squared lengths of respective vectors */\r\n /* cross2 = sin^2(theta) * a2 * b2 */\r\n /* For small theta, sin^2(theta)~~theta^2 */\r\n return cross * cross <= radianSquaredTol * a2 * b2;\r\n }\r\n /**\r\n * Test if this vector is perpendicular to other.\r\n * * The input tolerances in `options`, if given, are considered to be squared for efficiency's sake,\r\n * so if you have a distance or angle tolerance t, you should pass in t * t.\r\n * @param other second vector in comparison.\r\n * @param returnValueIfAnInputIsZeroLength if either vector is near zero length, return this value.\r\n * @param options optional radian and distance tolerances.\r\n */\r\n public isPerpendicularTo(\r\n other: Vector2d, returnValueIfAnInputIsZeroLength: boolean = false, options?: PerpParallelOptions\r\n ): boolean {\r\n const radianSquaredTol: number = options?.radianSquaredTol ?? Geometry.smallAngleRadiansSquared;\r\n const distanceSquaredTol: number = options?.distanceSquaredTol ?? Geometry.smallMetricDistanceSquared;\r\n const aa = this.magnitudeSquared();\r\n const bb = other.magnitudeSquared();\r\n if (aa < distanceSquaredTol || bb < distanceSquaredTol)\r\n return returnValueIfAnInputIsZeroLength;\r\n const ab = this.dotProduct(other);\r\n return ab * ab <= radianSquaredTol * aa * bb;\r\n }\r\n}\r\n"]}
|
|
@@ -430,13 +430,19 @@ export declare class Vector3d extends XYZ {
|
|
|
430
430
|
static unitY(scale?: number): Vector3d;
|
|
431
431
|
/** Return a unit Z vector optionally multiplied by a scale */
|
|
432
432
|
static unitZ(scale?: number): Vector3d;
|
|
433
|
-
/**
|
|
433
|
+
/**
|
|
434
|
+
* Scale the instance by 1.0/`denominator`.
|
|
435
|
+
* @param denominator number by which to divide the coordinates of this instance
|
|
436
|
+
* @param result optional pre-allocated object to return
|
|
437
|
+
* @return scaled vector, or undefined if `denominator` is exactly zero (in which case instance is untouched).
|
|
438
|
+
*/
|
|
434
439
|
safeDivideOrNull(denominator: number, result?: Vector3d): Vector3d | undefined;
|
|
435
440
|
/**
|
|
436
|
-
* Return a
|
|
437
|
-
*
|
|
438
|
-
*
|
|
439
|
-
*
|
|
441
|
+
* Return a normalized instance and instance length.
|
|
442
|
+
* @param result optional pre-allocated object to return as `v` property
|
|
443
|
+
* @returns object containing the properties:
|
|
444
|
+
* * `v`: unit vector in the direction of the instance, or undefined if `mag` is near zero
|
|
445
|
+
* * `mag`: length of the instance prior to normalization
|
|
440
446
|
*/
|
|
441
447
|
normalizeWithLength(result?: Vector3d): {
|
|
442
448
|
v: Vector3d | undefined;
|
|
@@ -449,7 +455,7 @@ export declare class Vector3d extends XYZ {
|
|
|
449
455
|
normalize(result?: Vector3d): Vector3d | undefined;
|
|
450
456
|
/**
|
|
451
457
|
* If this vector has nonzero length, divide by the length to change to a unit vector.
|
|
452
|
-
* @returns true if normalization
|
|
458
|
+
* @returns true if normalization was successful
|
|
453
459
|
*/
|
|
454
460
|
normalizeInPlace(): boolean;
|
|
455
461
|
/**
|
|
@@ -462,7 +468,7 @@ export declare class Vector3d extends XYZ {
|
|
|
462
468
|
* Return fractional projection of this vector on the target vector.
|
|
463
469
|
* * It's returning the signed projection magnitude divided by the target magnitude.
|
|
464
470
|
* * To find the projection vector, scale the target vector by the value that this function is returning.
|
|
465
|
-
* *
|
|
471
|
+
* * Math details can be found at docs/learning/geometry/PointVector.md
|
|
466
472
|
* * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/ProjectVectorOnVector
|
|
467
473
|
* and https://www.itwinjs.org/sandbox/SaeedTorabi/ProjectVectorOnPlane
|
|
468
474
|
* @param target the target vector
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Point3dVector3d.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/Point3dVector3d.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAY,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,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,EAAE,OAAO,EAAE,QAAQ,GAAG,MAAM;IAQpE;;;;;;;;;;OAUG;IACI,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,GAAG,KAAK;IAGjE;;;;;;OAMG;IACI,eAAe,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,GAAG,MAAM;IAaxE;;;;;;OAMG;IACI,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,GAAG,KAAK;IAGrE;;;OAGG;IACI,0BAA0B,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM;IAK5D;;;OAGG;IACI,wBAAwB,CAAC,OAAO,EAAE,QAAQ,GAAG,KAAK;IAGzD;;;;;;;;OAQG;IACI,YAAY,CAAC,KAAK,EAAE,QAAQ,EAAE,kBAAkB,GAAE,OAAe,EACtE,gCAAgC,GAAE,OAAe,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO;IAgB5F;;;;;;;OAOG;IACI,iBAAiB,CACtB,KAAK,EAAE,QAAQ,EAAE,gCAAgC,GAAE,OAAe,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAChG,OAAO;CAUX"}
|
|
@@ -850,7 +850,12 @@ export class Vector3d extends XYZ {
|
|
|
850
850
|
static unitZ(scale = 1) {
|
|
851
851
|
return new Vector3d(0, 0, scale);
|
|
852
852
|
}
|
|
853
|
-
/**
|
|
853
|
+
/**
|
|
854
|
+
* Scale the instance by 1.0/`denominator`.
|
|
855
|
+
* @param denominator number by which to divide the coordinates of this instance
|
|
856
|
+
* @param result optional pre-allocated object to return
|
|
857
|
+
* @return scaled vector, or undefined if `denominator` is exactly zero (in which case instance is untouched).
|
|
858
|
+
*/
|
|
854
859
|
safeDivideOrNull(denominator, result) {
|
|
855
860
|
if (denominator !== 0.0) {
|
|
856
861
|
return this.scale(1.0 / denominator, result);
|
|
@@ -858,15 +863,17 @@ export class Vector3d extends XYZ {
|
|
|
858
863
|
return undefined;
|
|
859
864
|
}
|
|
860
865
|
/**
|
|
861
|
-
* Return a
|
|
862
|
-
*
|
|
863
|
-
*
|
|
864
|
-
*
|
|
866
|
+
* Return a normalized instance and instance length.
|
|
867
|
+
* @param result optional pre-allocated object to return as `v` property
|
|
868
|
+
* @returns object containing the properties:
|
|
869
|
+
* * `v`: unit vector in the direction of the instance, or undefined if `mag` is near zero
|
|
870
|
+
* * `mag`: length of the instance prior to normalization
|
|
865
871
|
*/
|
|
866
872
|
normalizeWithLength(result) {
|
|
867
|
-
const
|
|
873
|
+
const originalMagnitude = this.magnitude();
|
|
874
|
+
const correctedMagnitude = Geometry.correctSmallFraction(originalMagnitude);
|
|
868
875
|
result = result ? result : new Vector3d();
|
|
869
|
-
return { v: this.safeDivideOrNull(
|
|
876
|
+
return { v: this.safeDivideOrNull(correctedMagnitude, result), mag: originalMagnitude };
|
|
870
877
|
}
|
|
871
878
|
/**
|
|
872
879
|
* Return a unit vector parallel with this. Return undefined if this.magnitude is near zero.
|
|
@@ -877,16 +884,10 @@ export class Vector3d extends XYZ {
|
|
|
877
884
|
}
|
|
878
885
|
/**
|
|
879
886
|
* If this vector has nonzero length, divide by the length to change to a unit vector.
|
|
880
|
-
* @returns true if normalization
|
|
887
|
+
* @returns true if normalization was successful
|
|
881
888
|
*/
|
|
882
889
|
normalizeInPlace() {
|
|
883
|
-
|
|
884
|
-
if (a === undefined)
|
|
885
|
-
return false;
|
|
886
|
-
this.x *= a;
|
|
887
|
-
this.y *= a;
|
|
888
|
-
this.z *= a;
|
|
889
|
-
return true;
|
|
890
|
+
return this.normalizeWithLength(this).v !== undefined;
|
|
890
891
|
}
|
|
891
892
|
/**
|
|
892
893
|
* Create a normalized vector from the inputs.
|
|
@@ -906,7 +907,7 @@ export class Vector3d extends XYZ {
|
|
|
906
907
|
* Return fractional projection of this vector on the target vector.
|
|
907
908
|
* * It's returning the signed projection magnitude divided by the target magnitude.
|
|
908
909
|
* * To find the projection vector, scale the target vector by the value that this function is returning.
|
|
909
|
-
* *
|
|
910
|
+
* * Math details can be found at docs/learning/geometry/PointVector.md
|
|
910
911
|
* * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/ProjectVectorOnVector
|
|
911
912
|
* and https://www.itwinjs.org/sandbox/SaeedTorabi/ProjectVectorOnPlane
|
|
912
913
|
* @param target the target vector
|
|
@@ -1121,7 +1122,7 @@ export class Vector3d extends XYZ {
|
|
|
1121
1122
|
* @param result optional preallocated result
|
|
1122
1123
|
*/
|
|
1123
1124
|
scaleToLength(length, result) {
|
|
1124
|
-
const mag = Geometry.
|
|
1125
|
+
const mag = Geometry.correctSmallFraction(this.magnitude());
|
|
1125
1126
|
if (mag === 0)
|
|
1126
1127
|
return undefined;
|
|
1127
1128
|
return this.scale(length / mag, result);
|
|
@@ -1172,7 +1173,7 @@ export class Vector3d extends XYZ {
|
|
|
1172
1173
|
* @param smallestMagnitude smallest magnitude allowed as divisor.
|
|
1173
1174
|
* @returns false if magnitude is too small. In this case the vector is unchanged.
|
|
1174
1175
|
*/
|
|
1175
|
-
tryNormalizeInPlace(smallestMagnitude = Geometry.
|
|
1176
|
+
tryNormalizeInPlace(smallestMagnitude = Geometry.smallFraction) {
|
|
1176
1177
|
const a = this.magnitude();
|
|
1177
1178
|
if (a < smallestMagnitude || a === 0.0)
|
|
1178
1179
|
return false;
|