Class: FdGeometric

FdMisc. FdGeometric

几何类


new FdGeometric()

Methods


<static> calcAngle(p0, p1, p2)

计算两个矢量的夹角

Parameters:
Name Type Description
p0 Cartesian3

p1指向p0

p1 Cartesian3

公共点

p2 Cartesian3

p1指向p2

Returns:

返回夹角值,单位是弧度


<static> calcAngle2D(xy1, xy2, xy3, xy4)

计算平面内两个矢量的夹角

Parameters:
Name Type Description
xy1 Object

第一个矢量的起点

xy2 Object

第一个矢量的终点

xy3 Object

第二个矢量的起点

xy4 Object

第二个矢量的终点

Returns:

返回夹角值,单位是度


<static> calculateLength(positions)

获取多段线的长度

Parameters:
Name Type Description
positions Array.<Cartesian3>

点组

Returns:

长度,单位米

Type
Number

<static> getCenter(p1, p1)

获取两个点的中心点

Parameters:
Name Type Description
p1 Cartesian3

起点

p1 Cartesian3

终点

Returns:

返回中点

Type
Cartesian3

<static> getCenterOfPts(pts)

获取一组点的中心点

Parameters:
Name Type Description
pts Array.<Cartesian3>

一组点

Returns:

中心点

Type
Cartesian3

<static> getLongAndLatRatio(cartPos)

获取指定位置的经纬度换算比例

Parameters:
Name Type Description
cartPos Cartographic

指定点

Returns:

返回数组,第一个值表示经度比例,第二个值表示纬度比例,乘以米数即可得到对应的经纬度值

Type
Array.<Number>

<static> pickPosition(viewer, windowPosition)

获取鼠标位置的世界坐标

Parameters:
Name Type Description
viewer Viewer

Viewer

windowPosition Object

鼠标屏幕坐标信息

Returns:

返回世界坐标

Type
Cartesian3

<static> pickPositionG(viewer, windowPosition)

获取鼠标位置的世界坐标

Parameters:
Name Type Description
viewer Viewer

Viewer

windowPosition Object

鼠标位置的屏幕坐标信息

Returns:

返回世界坐标[经度,纬度,高度],经纬度是以度为单位,高度以米为单位

Type
Array.<Number>

<static> tc(position)

转换为世界坐标

Parameters:
Name Type Description
position Array

[经度,纬度,高度],单位分别是度、度、米

Returns:

返回Cartesian3格式的坐标

Type
Cartesian3

<static> tg(position)

Cartesian3类型的点转换为[经度,纬度,高度]格式

Parameters:
Name Type Description
position Array

Cartesian3格式的点

Returns:

[经度,纬度,高度],单位分别是度、度、米

Type
Array.<Number>