Shapes
Functions to compute the boundary positions for shapes, such as circles, drawn on the ellipsoid.
Methods
-
<static> computeCircleBoundary
-
Computes boundary points for a circle on the ellipsoid.
Thegranularitydetermines the number of points in the boundary. A lower granularity results in more points and a more exact circle.
An outlined circle is rendered by passing the result of this function call to Polyline#setPositions. A filled circle is rendered by passing the result to Polygon#setPositions.Parameters:
Name Type Argument Description ellipsoidEllipsoid The ellipsoid the circle will be on. centerCartesian3 The circle's center point in the fixed frame. radiusNumber The radius in meters. granularityNumber <optional>
The angular distance between points on the circle. Throws:
-
DeveloperError : ellipsoid, center, and radius are required.
-
DeveloperError : radius must be greater than zero.
-
DeveloperError : granularity must be greater than zero.
Example
// Create a polyline of a circle var polyline = new Polyline(); polyline.setPositions(Shapes.computeCircleBoundary( ellipsoid, ellipsoid.cartographicToCartesian( Cartographic.fromDegrees(-75.59777, 40.03883, 0.0)), 100000.0));
-
-
<static> computeEllipseBoundary
-
Computes boundary points for an ellipse on the ellipsoid.
Thegranularitydetermines the number of points in the boundary. A lower granularity results in more points and a more exact circle.
An outlined ellipse is rendered by passing the result of this function call to Polyline#setPositions. A filled ellipse is rendered by passing the result to Polygon#setPositions.Parameters:
Name Type Argument Description ellipsoidEllipsoid The ellipsoid the ellipse will be on. centerCartesian3 The ellipse's center point in the fixed frame. semiMajorAxisNumber The length of the ellipse's semi-major axis in meters. semiMinorAxisNumber The length of the ellipse's semi-minor axis in meters. bearingNumber <optional>
The angle from north (clockwise) in radians. The default is zero. granularityNumber <optional>
The angular distance between points on the circle. Throws:
-
DeveloperError : ellipsoid, center, semiMajorAxis, and semiMinorAxis are required.
-
DeveloperError : Semi-major and semi-minor axes must be greater than zero.
-
DeveloperError : granularity must be greater than zero.
Returns:
The set of points that form the ellipse's boundary.Example
// Create a filled ellipse. var polygon = new Polygon(); polygon.setPositions(Shapes.computeEllipseBoundary( ellipsoid, ellipsoid.cartographicToCartesian( Cartographic.fromDegrees(-75.59777, 40.03883)), 500000.0, 300000.0, Math.toRadians(60)));
-
