Skip to content

projectionPosition

计算两个 Cartesian3 的投影点的 Cartesian3 坐标。

使用

js
const projection = projectionPosition(p0, p1)

有给定两向量 p0=(x0,y0,z0)p1=(x1,y1,z1),这个函数的推导如下:

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

类型声明

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