Skip to content

projectionPosition

Computes the Cartesian3 coordinates of two Cartesian3 projection points.

Usage

js
const projection = projectionPosition(p0, p1)

Give two vector p0=(x0,y0,z0) and p1=(x1,y1,z1), The derivation of this function is as follows:

  1. projection=kp0
  2. (kp0p1)p0=0
  3. k=p0p1p0p0

Type Declarations

Details
ts
/**
 * Get the projection position of p1 on p0
 *
 * ## example
 * ```js
 * const p0 = new Cesium.Cartesian3(1, 0, 0);
 * const p1 = new Cesium.Cartesian3(1, 1, 0);
 *
 * const projectedPosition = projectionPosition(p0, p1);
 * console.log(projectedPosition); // Output: Cartesian3 {x: 1, y: 0, z: 0}
 * ```
 */
export declare function projectionPosition(
  p0: Cesium.Cartesian3,
  p1: Cesium.Cartesian3,
): Cesium.Cartesian3

Source

source