Skip to content

xgis-cesium v0.1.7


xgis-cesium / XMath

Variable: XMath ​

const XMath: object

Defined in: src/math/index.ts:14

Type declaration ​

area() ​

area: (positions) => number

Parameters ​

positions ​

Cartesian3[] | Position[]

Returns ​

number

bounds() ​

bounds: (positions, expand) => boundResult

计算经纬点集合的 范围

Parameters ​

positions ​

ptItem[] = []

经纬度 点集合

expand ​

number = 0

Returns ​

boundResult

范围——经纬度

center() ​

center: (positions) => Position

计算中心点

Parameters ​

positions ​

Position[]

点集合

Returns ​

Position

经纬度位置

curve() ​

curve: (points, options?) => [number, number][]

计算一条曲线

Parameters ​

points ​

coordItem[]

点结合:经纬度

options? ​

每一段 多少个点

count? ​

number

Returns ​

[number, number][]

Direction ​

Direction: typeof default

distance() ​

distance: (positions) => number

计算点的球表面距离(有高度)

Parameters ​

positions ​

Position[]

Returns ​

number

米

heading() ​

heading: (start, end) => number

计算航线角 偏航角(20240906,已经测试)

Parameters ​

start ​

PositionType

点位 PositionType

end ​

PositionType

点位

Returns ​

number

倾角(弧度值)0为失败

hpr() ​

hpr: (start, end) => HeadingPitchRoll

新方法(实验中) 计算 A到B点的,航向对象HeadingPitchRoll

Parameters ​

start ​

PositionType

end ​

PositionType

Returns ​

HeadingPitchRoll

isBetween() ​

isBetween: (value, min, max) => boolean

Parameters ​

value ​

string | number

min ​

string | number

max ​

string | number

Returns ​

boolean

midCartesian() ​

midCartesian: (start, end) => Cartesian3

计算两点的中心点

Parameters ​

start ​

Cartesian3

笛卡尔坐标点

end ​

Cartesian3

笛卡尔坐标

Returns ​

Cartesian3

中心点——笛卡尔坐标

midPosition() ​

midPosition: (start, end) => Position

计算经纬度点的中心点

Parameters ​

start ​

PositionType

经纬度位置点

end ​

PositionType

经纬度位置点

Returns ​

Position

Position 经纬度位置点

parabola() ​

parabola: (startPosition, endPosition, height, count) => [number, number, number][]

计算经纬度两点的 抛物线数据

Parameters ​

startPosition ​

Position

endPosition ​

Position

height ​

number = 0

count ​

number = 50

Returns ​

[number, number, number][]

pitch() ​

pitch: (start, end) => number

新方法 计算 A到B点的,俯仰角Pitch

Parameters ​

start ​

PositionType

end ​

PositionType

Returns ​

number

pitch2() ​

pitch2: (start, end) => number

旧方法 根据两个坐标点,获取Pitch(仰角)

Parameters ​

start ​

PositionType

点位 PositionType

end ​

PositionType

点位

Returns ​

number

仰角,弧度值

resample() ​

resample: (positions, resampleNum) => Position[]

二分法 插值 重采样点

Parameters ​

positions ​

PositionType[]

点集合

resampleNum ​

number = 1

重采样几次,默认1次

Returns ​

Position[]

resampleByLerp() ​

resampleByLerp: (positionStart, positionEnd, numberOfSamples, powNum) => Cartesian3[]

lerp方法重采样

Parameters ​

positionStart ​

Position

起点

positionEnd ​

Position

终点

numberOfSamples ​

number = 10

samples采样总点数

powNum ​

number = 1

多少立方,默认1,加速:2, 减速:0.5

Returns ​

Cartesian3[]

resampleOnce() ​

resampleOnce: (positions) => Position[]

重采样一次

Parameters ​

positions ​

PositionType[]

经纬度点集合

Returns ​

Position[]

经纬度点集合

roll() ​

roll: (start, end) => number

新方法(实验中) 计算 A到B点的,翻滚角Roll

Parameters ​

start ​

PositionType

end ​

PositionType

Returns ​

number