English中文

Ellipsoid

new Cesium.Ellipsoid(x, y, z)

由方程在笛卡尔坐标中定义的二次曲面 A quadratic surface defined in Cartesian coordinates by the equation (x / a)^2 + (y / b)^2 + (z / c)^2 = 1。主要由Cesium用来表示行星体的形状。通常使用提供的常量之一,而不是直接构造该对象。 . Primarily used by Cesium to represent the shape of planetary bodies. Rather than constructing this object directly, one of the provided constants is normally used.
名称 Name 类型 Type 默认值 Default 说明 Description
x number 0 可选 optional x 方向的半径。 The radius in the x direction.
y number 0 可选 optional y 方向的半径。 The radius in the y direction.
z number 0 可选 optional z 方向的半径。 The radius in the z direction.
抛出: Throws:
  • DeveloperError :所有半径分量必须大于或等于零。 : All radii components must be greater than or equal to zero.
另见: See:

成员 Members

static Cesium.Ellipsoid.default : Ellipsoid

未另行指定时使用默认椭球体。 The default ellipsoid used when not otherwise specified.
示例: Example:
Cesium.Ellipsoid.default = Cesium.Ellipsoid.MOON;

// Apollo 11 landing site
const position = Cesium.Cartesian3.fromRadians(
  0.67416,
  23.47315,
);

static constant Cesium.Ellipsoid.MARS : Ellipsoid

一个椭球体实例,初始化为具有火星平均半径的球体。来源:https://epsg.io/104905 An Ellipsoid instance initialized to a sphere with the mean radii of Mars. Source: https://epsg.io/104905

static constant Cesium.Ellipsoid.MOON : Ellipsoid

一个椭球体实例,初始化为具有月球半径的球体。 An Ellipsoid instance initialized to a sphere with the lunar radius.

static Cesium.Ellipsoid.packedLength : number

用于将对象打包到数组中的元素数量。 The number of elements used to pack the object into an array.

static constant Cesium.Ellipsoid.UNIT_SPHERE : Ellipsoid

初始化为半径 (1.0, 1.0, 1.0) 的椭圆体实例。 An Ellipsoid instance initialized to radii of (1.0, 1.0, 1.0).

static constant Cesium.Ellipsoid.WGS84 : Ellipsoid

初始化为 WGS84 标准的椭球体实例。 An Ellipsoid instance initialized to the WGS84 standard.

readonly maximumRadius : number

获取椭球体的最大半径。 Gets the maximum radius of the ellipsoid.

readonly minimumRadius : number

获取椭球体的最小半径。 Gets the minimum radius of the ellipsoid.
获取椭球体半径上的一倍。 Gets one over the radii of the ellipsoid.

readonly oneOverRadiiSquared : Cartesian3

获取椭球体半径平方的一倍。 Gets one over the squared radii of the ellipsoid.
获取椭球体的半径。 Gets the radii of the ellipsoid.
获取椭球体的半径平方。 Gets the squared radii of the ellipsoid.

readonly radiiToTheFourth : Cartesian3

获取椭球半径的四次方。 Gets the radii of the ellipsoid raise to the fourth power.

方法 Methods

static Cesium.Ellipsoid.clone(ellipsoid, result)Ellipsoid

Duplicates an Ellipsoid instance.
名称 Name 类型 Type 说明 Description
ellipsoid Ellipsoid 要复制的椭球体。 The ellipsoid to duplicate.
result Ellipsoid 可选 optional 用于存储结果的对象,如果应创建新实例,则为未定义。 The object onto which to store the result, or undefined if a new instance should be created.
返回: Returns:
克隆的椭球体。 (如果椭球体未定义,则返回未定义) The cloned Ellipsoid. (Returns undefined if ellipsoid is undefined)

static Cesium.Ellipsoid.fromCartesian3(cartesian, result)Ellipsoid

根据指定 x、y 和 z 方向半径的笛卡尔坐标计算椭球体。 Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions.
名称 Name 类型 Type 默认值 Default 说明 Description
cartesian Cartesian3 Cartesian3.ZERO 可选 optional 椭球在 x、y 和 z 方向上的半径。 The ellipsoid's radius in the x, y, and z directions.
result Ellipsoid 可选 optional 用于存储结果的对象,如果应创建新实例,则为未定义。 The object onto which to store the result, or undefined if a new instance should be created.
返回: Returns:
一个新的椭球体实例。 A new Ellipsoid instance.
抛出: Throws:
  • DeveloperError :所有半径分量必须大于或等于零。 : All radii components must be greater than or equal to zero.
另见: See:

static Cesium.Ellipsoid.pack(value, array, startingIndex)Array.<number>

将提供的实例存储到提供的数组中。 Stores the provided instance into the provided array.
名称 Name 类型 Type 默认值 Default 说明 Description
value Ellipsoid 包装的价值。 The value to pack.
array Array.<number> 要打包到的数组。 The array to pack into.
startingIndex number 0 可选 optional 开始打包元素的数组索引。 The index into the array at which to start packing the elements.
返回: Returns:
被打包成的数组 The array that was packed into

static Cesium.Ellipsoid.unpack(array, startingIndex, result)Ellipsoid

从打包数组中检索实例。 Retrieves an instance from a packed array.
名称 Name 类型 Type 默认值 Default 说明 Description
array Array.<number> 打包的数组。 The packed array.
startingIndex number 0 可选 optional 要解包的元素的起始索引。 The starting index of the element to be unpacked.
result Ellipsoid 可选 optional 用于存储结果的对象。 The object into which to store the result.
返回: Returns:
修改后的结果参数或新的椭球体实例(如果未提供)。 The modified result parameter or a new Ellipsoid instance if one was not provided.

cartesianArrayToCartographicArray(cartesians, result)Array.<Cartographic>

将提供的笛卡尔数组转换为制图数组。 Converts the provided array of cartesians to an array of cartographics.
名称 Name 类型 Type 说明 Description
cartesians Array.<Cartesian3> 笛卡尔位置数组。 An array of Cartesian positions.
result Array.<Cartographic> 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数或新的数组实例(如果未提供)。 The modified result parameter or a new Array instance if none was provided.
示例: Example:
//Create an array of Cartesians and determine their Cartographic representation on a WGS84 ellipsoid.
const positions = [new Cesium.Cartesian3(17832.12, 83234.52, 952313.73),
                 new Cesium.Cartesian3(17832.13, 83234.53, 952313.73),
                 new Cesium.Cartesian3(17832.14, 83234.54, 952313.73)]
const cartographicPositions = Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray(positions);

cartesianToCartographic(cartesian, result)Cartographic

将提供的笛卡尔坐标转换为制图表示形式。笛卡尔坐标在椭球体中心处未定义。 Converts the provided cartesian to cartographic representation. The cartesian is undefined at the center of the ellipsoid.
名称 Name 类型 Type 说明 Description
cartesian Cartesian3 要转换为制图表示的笛卡尔位置。 The Cartesian position to convert to cartographic representation.
result Cartographic 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数,如果未提供则为新的制图实例,如果笛卡尔位于椭球体的中心则为未定义。 The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.
示例: Example:
//Create a Cartesian and determine it's Cartographic representation on a WGS84 ellipsoid.
const position = new Cesium.Cartesian3(17832.12, 83234.52, 952313.73);
const cartographicPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position);

cartographicArrayToCartesianArray(cartographics, result)Array.<Cartesian3>

将提供的制图数组转换为笛卡尔数组。 Converts the provided array of cartographics to an array of Cartesians.
名称 Name 类型 Type 说明 Description
cartographics Array.<Cartographic> 一系列制图位置。 An array of cartographic positions.
result Array.<Cartesian3> 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数或新的数组实例(如果未提供)。 The modified result parameter or a new Array instance if none was provided.
示例: Example:
//Convert an array of Cartographics and determine their Cartesian representation on a WGS84 ellipsoid.
const positions = [new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 0),
                 new Cesium.Cartographic(Cesium.Math.toRadians(21.321), Cesium.Math.toRadians(78.123), 100),
                 new Cesium.Cartographic(Cesium.Math.toRadians(21.645), Cesium.Math.toRadians(78.456), 250)];
const cartesianPositions = Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(positions);

cartographicToCartesian(cartographic, result)Cartesian3

将提供的制图转换为笛卡尔表示。 Converts the provided cartographic to Cartesian representation.
名称 Name 类型 Type 说明 Description
cartographic Cartographic 制图位置。 The cartographic position.
result Cartesian3 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数或新的 Cartesian3 实例(如果未提供)。 The modified result parameter or a new Cartesian3 instance if none was provided.
示例: Example:
//Create a Cartographic and determine it's Cartesian representation on a WGS84 ellipsoid.
const position = new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 5000);
const cartesianPosition = Cesium.Ellipsoid.WGS84.cartographicToCartesian(position);
Duplicates an Ellipsoid instance.
名称 Name 类型 Type 说明 Description
result Ellipsoid 可选 optional 用于存储结果的对象,如果应创建新实例,则为未定义。 The object onto which to store the result, or undefined if a new instance should be created.
返回: Returns:
克隆的椭球体。 The cloned Ellipsoid.

equals(right)boolean

将此椭球体与提供的椭球体分量进行比较并返回 Compares this Ellipsoid against the provided Ellipsoid componentwise and returns true 如果它们相等, if they are equal, false otherwise.
名称 Name 类型 Type 说明 Description
right Ellipsoid 可选 optional 另一个椭球体。 The other Ellipsoid.
返回: Returns:
true 如果它们相等, if they are equal, false otherwise.

geocentricSurfaceNormal(cartesian, result)Cartesian3

计算从该椭球中心指向提供的笛卡尔位置的单位向量。 Computes the unit vector directed from the center of this ellipsoid toward the provided Cartesian position.
名称 Name 类型 Type 说明 Description
cartesian Cartesian3 用于确定地心法线的笛卡尔坐标。 The Cartesian for which to to determine the geocentric normal.
result Cartesian3 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数或新的 Cartesian3 实例(如果未提供)。 The modified result parameter or a new Cartesian3 instance if none was provided.

geodeticSurfaceNormal(cartesian, result)Cartesian3

计算与所提供位置处的椭球体表面相切的平面的法线。 Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
名称 Name 类型 Type 说明 Description
cartesian Cartesian3 确定曲面法线的笛卡尔位置。 The Cartesian position for which to to determine the surface normal.
result Cartesian3 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数或新的 Cartesian3 实例(如果未提供)或未定义(如果无法找到法线)。 The modified result parameter or a new Cartesian3 instance if none was provided, or undefined if a normal cannot be found.

geodeticSurfaceNormalCartographic(cartographic, result)Cartesian3

计算与所提供位置处的椭球体表面相切的平面的法线。 Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
名称 Name 类型 Type 说明 Description
cartographic Cartographic 确定大地法线的制图位置。 The cartographic position for which to to determine the geodetic normal.
result Cartesian3 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数或新的 Cartesian3 实例(如果未提供)。 The modified result parameter or a new Cartesian3 instance if none was provided.

getLocalCurvature(surfacePosition, result)Cartesian2

计算表面上给定位置处的椭球曲率。 Computes the ellipsoid curvatures at a given position on the surface.
名称 Name 类型 Type 说明 Description
surfacePosition Cartesian3 将计算曲率的椭球表面上的位置。 The position on the ellipsoid surface where curvatures will be calculated.
result Cartesian2 可选 optional 将结果复制到的笛卡尔坐标,或未定义以创建并返回新实例。 The cartesian to which to copy the result, or undefined to create and return a new instance.
返回: Returns:
椭圆体表面在所提供位置的东向和北向的局部曲率。 The local curvature of the ellipsoid surface at the provided position, in east and north directions.
抛出: Throws:

getSurfaceNormalIntersectionWithZAxis(position, buffer, result)Cartesian3|undefined

计算表面法线与 z 轴的交点。 Computes a point which is the intersection of the surface normal with the z-axis.
名称 Name 类型 Type 默认值 Default 说明 Description
position Cartesian3 的位置。必须在椭球体的表面上。 the position. must be on the surface of the ellipsoid.
buffer number 0.0 可选 optional 检查点是否位于椭球体内部时从椭球体大小中减去的缓冲区。在地球情况下,使用常见的地球基准,不需要此缓冲区,因为交点总是(相对)非常靠近中心。在 WGS84 基准中,交点位于最大 z = +-42841.31151331382(z 轴的 0.673%)。如果 MajorAxis / AxisOfRotation 的比率大于 2 的平方根,则交点可能位于椭球体之外 A buffer to subtract from the ellipsoid size when checking if the point is inside the ellipsoid. In earth case, with common earth datums, there is no need for this buffer since the intersection point is always (relatively) very close to the center. In WGS84 datum, intersection point is at max z = +-42841.31151331382 (0.673% of z-axis). Intersection point could be outside the ellipsoid if the ratio of MajorAxis / AxisOfRotation is bigger than the square root of 2
result Cartesian3 可选 optional 将结果复制到的笛卡尔坐标,或未定义以创建并返回新实例。 The cartesian to which to copy the result, or undefined to create and return a new instance.
返回: Returns:
如果交点在椭球体内,则为交点,否则未定义 the intersection point if it's inside the ellipsoid, undefined otherwise
抛出: Throws:
  • DeveloperError : 位置为必填项。 : position is required.
  • DeveloperError : Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y).
  • DeveloperError :Ellipsoid.radii.z 必须大于 0。 : Ellipsoid.radii.z must be greater than 0.

scaleToGeocentricSurface(cartesian, result)Cartesian3

沿地心表面法线缩放提供的笛卡尔位置,使其位于该椭球体的表面上。 Scales the provided Cartesian position along the geocentric surface normal so that it is on the surface of this ellipsoid.
名称 Name 类型 Type 说明 Description
cartesian Cartesian3 笛卡尔位置缩放。 The Cartesian position to scale.
result Cartesian3 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数或新的 Cartesian3 实例(如果未提供)。 The modified result parameter or a new Cartesian3 instance if none was provided.

scaleToGeodeticSurface(cartesian, result)Cartesian3

沿大地表面法线缩放提供的笛卡尔位置,使其位于该椭球体的表面上。如果位置位于椭球体的中心,则该函数返回未定义。 Scales the provided Cartesian position along the geodetic surface normal so that it is on the surface of this ellipsoid. If the position is at the center of the ellipsoid, this function returns undefined.
名称 Name 类型 Type 说明 Description
cartesian Cartesian3 笛卡尔位置缩放。 The Cartesian position to scale.
result Cartesian3 可选 optional 用于存储结果的对象。 The object onto which to store the result.
返回: Returns:
修改后的结果参数,如果未提供则为新的 Cartesian3 实例,如果位置位于中心则为未定义。 The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.

surfaceArea(rectangle)number

使用高斯-勒让德 10 阶求积计算椭球体表面上的矩形表面积的近似值。 Computes an approximation of the surface area of a rectangle on the surface of an ellipsoid using Gauss-Legendre 10th order quadrature.
名称 Name 类型 Type 说明 Description
rectangle Rectangle 用于计算表面积的矩形。 The rectangle used for computing the surface area.
返回: Returns:
该椭球体表面上的矩形的近似面积。 The approximate area of the rectangle on the surface of this ellipsoid.

toString()string

创建一个表示此椭球体的字符串,格式为“(radii.x, radii.y, radii.z)”。 Creates a string representing this Ellipsoid in the format '(radii.x, radii.y, radii.z)'.
返回: Returns:
表示该椭球体的字符串,格式为“(radii.x, radii.y, radii.z)”。 A string representing this ellipsoid in the format '(radii.x, radii.y, radii.z)'.

transformPositionFromScaledSpace(position, result)Cartesian3

通过将其分量乘以以下结果,从椭球尺度空间变换笛卡尔 X、Y、Z 位置 Transforms a Cartesian X, Y, Z position from the ellipsoid-scaled space by multiplying its components by the result of Ellipsoid#radii.
名称 Name 类型 Type 说明 Description
position Cartesian3 位置要变换。 The position to transform.
result Cartesian3 可选 optional 将结果复制到的位置,或未定义以创建并返回新实例。 The position to which to copy the result, or undefined to create and return a new instance.
返回: Returns:
在未缩放的空间中表示的位置。返回的实例是作为结果参数传递的实例(如果未定义),或者是它的新实例。 The position expressed in the unscaled space. The returned instance is the one passed as the result parameter if it is not undefined, or a new instance of it is.

transformPositionToScaledSpace(position, result)Cartesian3

通过将其分量乘以以下结果,将笛卡尔 X、Y、Z 位置转换为椭球尺度空间 Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying its components by the result of Ellipsoid#oneOverRadii.
名称 Name 类型 Type 说明 Description
position Cartesian3 位置要变换。 The position to transform.
result Cartesian3 可选 optional 将结果复制到的位置,或未定义以创建并返回新实例。 The position to which to copy the result, or undefined to create and return a new instance.
返回: Returns:
在缩放空间中表示的位置。返回的实例是作为结果参数传递的实例(如果未定义),或者是它的新实例。 The position expressed in the scaled space. The returned instance is the one passed as the result parameter if it is not undefined, or a new instance of it is.
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.