API Reference > geometry-core > CartesianGeometry > Point3d Point3d Class 3D point with x,y,z as properties Extends XYZ Implements { T } Methods Name Description constructor(x: number = 0, y: number = 0, z: number = 0): Point3d Constructor for Point3d clone(result?: Point3d): Point3d Return a new Point3d with the same coordinates crossProductToPoints(pointA: Point3d, pointB: Point3d, result?: Vector3d): Vector3d Return the cross product of the vectors from this to pointA and pointB crossProductToPointsMagnitude(pointA: Point3d, pointB: Point3d): number Return the magnitude of the cross product of the vectors from this to pointA and pointB crossProductToPointsXY(pointA: Point3d, pointB: Point3d): number Return the cross product of the vectors from this to pointA and pointB dotVectorsToTargets(targetA: Point3d, targetB: Point3d): number Return the dot product of vectors from this to pointA and this to pointB. fractionOfProjectionToLine(startPoint: Point3d, endPoint: Point3d, defaultFraction: number = 0): number Return the fractional projection of this onto a line between points. interpolate(fraction: number, other: XYAndZ, result?: Point3d): Point3d Return a point interpolated between this point and the right param. interpolatePerpendicularXY(fraction: number, pointB: Point3d, fractionXYPerp: number, result?: Point3d): Point3d Interpolate between points, then add a shift in the xy plane by a fraction of the XY projection perpendicular. interpolatePointAndTangent(fraction: number, other: Point3d, tangentScale: number, result?: Ray3d): Ray3d Return a ray whose ray.origin is interpolated, and ray.direction is the vector between points with a interpolateXYZ(fractionX: number, fractionY: number, fractionZ: number, other: Point3d, result?: Point3d): Point3d Return a point with independent x,y,z fractional interpolation. minus(vector: XYAndZ, result?: Point3d): Point3d Return point minus vector plus(vector: XYAndZ, result?: Point3d): Point3d Return point plus vector plus2Scaled(vectorA: XYAndZ, scalarA: number, vectorB: XYZ, scalarB: number, result?: Point3d): Point3d Return point + vectorA * scalarA + vectorB * scalarB plus3Scaled(vectorA: XYAndZ, scalarA: number, vectorB: XYAndZ, scalarB: number, vectorC: XYAndZ, scalarC: number, result?: Point3d): Point3d Return point + vectorA * scalarA + vectorB * scalarB + vectorC * scalarC plusScaled(vector: XYAndZ, scaleFactor: number, result?: Point3d): Point3d Return point + vector * scalar plusXYZ(dx: number = 0, dy: number = 0, dz: number = 0, result?: Point3d): Point3d Return point plus vector tripleProductToPoints(pointA: Point3d, pointB: Point3d, pointC: Point3d): number Return the triple product of the vectors from this to pointA, pointB, pointC create(x: number = 0, y: number = 0, z: number = 0, result?: Point3d): Point3d Static Create a new Point3d with given coordinates createAdd2Scaled(pointA: XYAndZ, scaleA: number, pointB: XYAndZ, scaleB: number, result?: Point3d): Point3d Static create a point that is a linear combination (weighted sum) of 2 input points. createAdd3Scaled(pointA: XYAndZ, scaleA: number, pointB: XYAndZ, scaleB: number, pointC: XYAndZ, scaleC: number, result?: Point3d): Point3d Static Create a point that is a linear combination (weighted sum) of 3 input points. createFrom(data: XYAndZ | XAndY | Float64Array, result?: Point3d): Point3d Static Copy contents from another Point3d, Point2d, Vector2d, or Vector3d createFromPacked(xyzData: Float64Array, pointIndex: number, result?: Point3d): Point3d | undefined Static Copy x,y,z from createFromPackedXYZW(xyzData: Float64Array, pointIndex: number, result?: Point3d): Point3d | undefined Static Copy and unweight xyzw. createScale(source: XYAndZ, scale: number, result?: Point3d): Point3d Static Return a point that is scaled from the source point. createZero(result?: Point3d): Point3d Static Create a new point with 000 xyz fromJSON(json?: XYZProps): Point3d Static Convert json to Point3d. Inherited methods Name Inherited from Description addInPlace(other: XYAndZ): void XYZ add x,y,z from other in place. addScaledInPlace(other: XYAndZ, scale: number): void XYZ add (in place) the scaled x,y,z of other addXYZInPlace(dx: number = 0, dy: number = 0, dz: number = 0): void XYZ add to x, y, z parts at(index: number): number XYZ Return the x,y, z component corresponding to 0,1,2. cloneAsPoint3d(): Point3d XYZ Clone strongly typed as Point3d distance(other: XYAndZ): number XYZ Return the distance from this point to other distanceSquared(other: XYAndZ): number XYZ Return squared distance from this point to other distanceSquaredXY(other: XAndY): number XYZ Return squared XY distance from this point to other distanceXY(other: XAndY): number XYZ Return the XY distance from this point to other freeze(): void XYZ Freeze this XYZ indexOfMaxAbs(): number XYZ Return the index (0,1,2) of the x,y,z component with largest absolute value isAlmostEqual(other: XYAndZ, tol?: number): boolean XYZ Returns true if this and other have equal x,y,z parts within Geometry.smallMetricDistance. isAlmostEqualMetric(other: XYAndZ): boolean XYZ equality test with Geometry.smallMetricDistance tolerance isAlmostEqualXY(other: XAndY, tol?: number): boolean XYZ Return true if this and other have equal x,y parts within Geometry.smallMetricDistance. isAlmostEqualXYZ(x: number, y: number, z: number, tol?: number): boolean XYZ Return true if this and other have equal x,y,z parts within Geometry.smallMetricDistance. isExactEqual(other: XYAndZ): boolean XYZ exact equality test. magnitude(): number XYZ Return the sqrt of the sum of squared x,y,z parts magnitudeSquared(): number XYZ Return the sum of squared x,y,z parts magnitudeSquaredXY(): number XYZ Return the sum of squared x,y parts magnitudeXY(): number XYZ Return sqrt of the sum of squared x,y parts maxAbs(): number XYZ Return the largest absolute value of any component maxDiff(other: XYAndZ): number XYZ Return the largest absolute distance between corresponding components scaleInPlace(scale: number): void XYZ Multiply the x, y, z parts by scale. scaledVectorTo(other: XYAndZ, scale: number, result?: Vector3d): Vector3d XYZ Return a multiple of a the (full length) vector from this point to other set(x: number = 0, y: number = 0, z: number = 0): void XYZ Set the x,y,z parts. setAt(index: number, value: number): void XYZ Return the x,y, z component corresponding to 0,1,2. setFrom(other: Float64Array | XAndY | XYAndZ | undefined): void XYZ Set the x,y,z parts from one of these input types setFromJSON(json?: XYZProps): void XYZ Set the x,y,z properties from one of several json forms: setFromPoint3d(other?: XYAndZ): void XYZ Set the x,y,z parts from a Point3d. setFromVector3d(other: Vector3d): void XYZ Set the x,y,z parts from a Vector3d setZero(): void XYZ Set the x,y,z parts to zero. subtractInPlace(other: XYAndZ): void XYZ add x,y,z from other in place. toFloat64Array(): Float64Array XYZ Pack the x,y,z values in a Float64Array. toJSON(): XYZProps XYZ Return a JSON object as array [x,y,z] toJSONXYZ(): XYZProps XYZ Return a JSON object as key value pairs {x: value, y: value, z: value} unitVectorTo(target: XYAndZ, result?: Vector3d): Vector3d | undefined XYZ Return a unit vector from this vector to other. vectorTo(other: XYAndZ, result?: Vector3d): Vector3d XYZ Return a (full length) vector from this point to other accessX(arg: any, defaultValue?: number): number | undefined Static XYZ Look for (in order) an x coordinate present as: accessY(arg: any, defaultValue?: number): number | undefined Static XYZ Look for (in order) an x coordinate present as: accessZ(arg: any, defaultValue?: number): number | undefined Static XYZ Look for (in order) an x coordinate present as: hasZ(arg: any): arg is HasZ Static XYZ Type guard to determine whether an object has a member called "z" isAnyImmediatePointType(arg: any): boolean Static XYZ Test if arg is any of: isXAndY(arg: any): arg is XAndY Static XYZ Type guard for XAndY. isXYAndZ(arg: any): arg is XYAndZ Static XYZ Type guard for XYAndZ. Inherited properties Name Type Inherited from Description isAlmostZero Accessor ReadOnly boolean XYZ Return true if the if x,y,z components are all nearly zero to tolerance Geometry.smallMetricDistance x number XYZ x coordinate y number XYZ y coordinate z number XYZ z coordinate Defined in core/geometry/src/geometry3d/Point3dVector3d.ts Line 302 Last Updated: 13 June, 2024