Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Cartesian3
    • Vector3

Index

Constructors

constructor

  • new Vector3(x?: number, y?: number, z?: number): Vector3
  • Parameters

    • Optional x: number
    • Optional y: number
    • Optional z: number

    Returns Vector3

Properties

x

x: number

The X component.

y

y: number

The Y component.

z

z: number

The Z component.

Static Readonly IDENTIFY

IDENTIFY: Vector3

Static Readonly IDENTITY

IDENTITY: Cartesian3

An immutable Cartesian3 instance initialized to (1.0, 1.0, 1.0).

Static Readonly UNIT_X

UNIT_X: Cartesian3

An immutable Cartesian3 instance initialized to (1.0, 0.0, 0.0).

Static Readonly UNIT_Y

UNIT_Y: Cartesian3

An immutable Cartesian3 instance initialized to (0.0, 1.0, 0.0).

Static Readonly UNIT_Z

UNIT_Z: Cartesian3

An immutable Cartesian3 instance initialized to (0.0, 0.0, 1.0).

Static Readonly ZERO

ZERO: Cartesian3

An immutable Cartesian3 instance initialized to (0.0, 0.0, 0.0).

Static packedLength

packedLength: number

The number of elements used to pack the object into an array.

Methods

clone

  • clone(result?: Cartesian3): Cartesian3
  • Duplicates this Cartesian3 instance.

    Parameters

    • Optional result: Cartesian3

    Returns Cartesian3

    The modified result parameter or a new Cartesian3 instance if one was not provided.

equals

  • equals(right?: Cartesian3): boolean
  • Compares this Cartesian against the provided Cartesian componentwise and returns true if they are equal, false otherwise.

    Parameters

    • Optional right: Cartesian3

    Returns boolean

    true if they are equal, false otherwise.

equalsEpsilon

  • equalsEpsilon(right?: Cartesian3, relativeEpsilon?: number, absoluteEpsilon?: number): boolean
  • Compares this Cartesian against the provided Cartesian componentwise and returns true if they pass an absolute or relative tolerance test, false otherwise.

    Parameters

    • Optional right: Cartesian3
    • Optional relativeEpsilon: number
    • Optional absoluteEpsilon: number

    Returns boolean

    true if they are within the provided epsilon, false otherwise.

toString

  • toString(): string
  • Creates a string representing this Cartesian in the format '(x, y, z)'.

    Returns string

    A string representing this Cartesian in the format '(x, y, z)'.

Static abs

  • abs(cartesian: Cartesian3, result: Cartesian3): Cartesian3
  • Computes the absolute value of the provided Cartesian.

    Parameters

    • cartesian: Cartesian3

      The Cartesian whose absolute value is to be computed.

    • result: Cartesian3

      The object onto which to store the result.

    Returns Cartesian3

    The modified result parameter.

Static add

  • add(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3
  • Computes the componentwise sum of two Cartesians.

    Parameters

    • left: Cartesian3

      The first Cartesian.

    • right: Cartesian3

      The second Cartesian.

    • result: Cartesian3

      The object onto which to store the result.

    Returns Cartesian3

    The modified result parameter.

Static angleBetween

  • angleBetween(left: Cartesian3, right: Cartesian3): number
  • Returns the angle, in radians, between the provided Cartesians.

    Parameters

    • left: Cartesian3

      The first Cartesian.

    • right: Cartesian3

      The second Cartesian.

    Returns number

    The angle between the Cartesians.

Static ceil

  • ceil(cartesian: Cartesian3, result: Cartesian3): Cartesian3
  • 向上取整

    Parameters

    • cartesian: Cartesian3
    • result: Cartesian3

    Returns Cartesian3

Static clone

  • clone(cartesian: Cartesian3, result?: Cartesian3): Cartesian3
  • Duplicates a Cartesian3 instance.

    Parameters

    • cartesian: Cartesian3

      The Cartesian to duplicate.

    • Optional result: Cartesian3

    Returns Cartesian3

    The modified result parameter or a new Cartesian3 instance if one was not provided. (Returns undefined if cartesian is undefined)

Static cross

  • cross(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3
  • Computes the cross (outer) product of two Cartesians.

    Parameters

    • left: Cartesian3

      The first Cartesian.

    • right: Cartesian3

      The second Cartesian.

    • result: Cartesian3

      The object onto which to store the result.

    Returns Cartesian3

    The cross product.

Static distance

  • distance(left: Cartesian3, right: Cartesian3): number
  • Computes the distance between two points.

    example

    // Returns 1.0 var d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0));

    Parameters

    • left: Cartesian3

      The first point to compute the distance from.

    • right: Cartesian3

      The second point to compute the distance to.

    Returns number

    The distance between two points.

Static distanceSquared

  • distanceSquared(left: Cartesian3, right: Cartesian3): number
  • Computes the squared distance between two points. Comparing squared distances using this function is more efficient than comparing distances using {@link Cartesian3#distance}.

    example

    // Returns 4.0, not 2.0 var d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0));

    Parameters

    • left: Cartesian3

      The first point to compute the distance from.

    • right: Cartesian3

      The second point to compute the distance to.

    Returns number

    The distance between two points.

Static divideByScalar

  • divideByScalar(cartesian: Cartesian3, scalar: number, result: Cartesian3): Cartesian3
  • Divides the provided Cartesian componentwise by the provided scalar.

    Parameters

    • cartesian: Cartesian3

      The Cartesian to be divided.

    • scalar: number

      The scalar to divide by.

    • result: Cartesian3

      The object onto which to store the result.

    Returns Cartesian3

    The modified result parameter.

Static divideComponents

  • divideComponents(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3
  • Computes the componentwise quotient of two Cartesians.

    Parameters

    • left: Cartesian3

      The first Cartesian.

    • right: Cartesian3

      The second Cartesian.

    • result: Cartesian3

      The object onto which to store the result.

    Returns Cartesian3

    The modified result parameter.

Static dot

  • dot(left: Cartesian3, right: Cartesian3): number
  • Computes the dot (scalar) product of two Cartesians.

    Parameters

    • left: Cartesian3

      The first Cartesian.

    • right: Cartesian3

      The second Cartesian.

    Returns number

    The dot product.

Static equals

  • equals(left?: Cartesian3, right?: Cartesian3): boolean
  • Compares the provided Cartesians componentwise and returns true if they are equal, false otherwise.

    Parameters

    • Optional left: Cartesian3
    • Optional right: Cartesian3

    Returns boolean

    true if left and right are equal, false otherwise.

Static equalsEpsilon

  • equalsEpsilon(left?: Cartesian3, right?: Cartesian3, relativeEpsilon?: number, absoluteEpsilon?: number): boolean
  • Compares the provided Cartesians componentwise and returns true if they pass an absolute or relative tolerance test, false otherwise.

    Parameters

    • Optional left: Cartesian3
    • Optional right: Cartesian3
    • Optional relativeEpsilon: number
    • Optional absoluteEpsilon: number

    Returns boolean

    true if left and right are within the provided epsilon, false otherwise.

Static floor

  • floor(cartesian: Cartesian3, result: Cartesian3): Cartesian3
  • 向下取整

    Parameters

    • cartesian: Cartesian3
    • result: Cartesian3

    Returns Cartesian3

Static fromArray

Static fromCartesian4

  • fromCartesian4(cartesian: Cartesian4, result?: Cartesian3): Cartesian3
  • Creates a Cartesian3 instance from an existing Cartesian4. This simply takes the x, y, and z properties of the Cartesian4 and drops w.

    Parameters

    • cartesian: Cartesian4

      The Cartesian4 instance to create a Cartesian3 instance from.

    • Optional result: Cartesian3

    Returns Cartesian3

    The modified result parameter or a new Cartesian3 instance if one was not provided.

Static fromDegrees

  • fromDegrees(longitude: number, latitude: number, height?: number, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3
  • Returns a Cartesian3 position from longitude and latitude values given in degrees.

    example

    var position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0);

    Parameters

    • longitude: number

      The longitude, in degrees

    • latitude: number

      The latitude, in degrees

    • Optional height: number
    • Optional ellipsoid: Ellipsoid
    • Optional result: Cartesian3

    Returns Cartesian3

    The position

Static fromDegreesArray

  • fromDegreesArray(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[]
  • Returns an array of Cartesian3 positions given an array of longitude and latitude values given in degrees.

    example

    var positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]);

    Parameters

    • coordinates: number[]

      A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...].

    • Optional ellipsoid: Ellipsoid
    • Optional result: Cartesian3[]

    Returns Cartesian3[]

    The array of positions.

Static fromDegreesArrayHeights

  • fromDegreesArrayHeights(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[]
  • Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in degrees.

    example

    var positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]);

    Parameters

    • coordinates: number[]

      A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...].

    • Optional ellipsoid: Ellipsoid
    • Optional result: Cartesian3[]

    Returns Cartesian3[]

    The array of positions.

Static fromElements

  • fromElements(x: number, y: number, z: number, result?: Cartesian3): Cartesian3
  • Creates a Cartesian3 instance from x, y and z coordinates.

    Parameters

    • x: number

      The x coordinate.

    • y: number

      The y coordinate.

    • z: number

      The z coordinate.

    • Optional result: Cartesian3

    Returns Cartesian3

    The modified result parameter or a new Cartesian3 instance if one was not provided.

Static fromRadians

  • fromRadians(longitude: number, latitude: number, height?: number, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3
  • Returns a Cartesian3 position from longitude and latitude values given in radians.

    example

    var position = Cesium.Cartesian3.fromRadians(-2.007, 0.645);

    Parameters

    • longitude: number

      The longitude, in radians

    • latitude: number

      The latitude, in radians

    • Optional height: number
    • Optional ellipsoid: Ellipsoid
    • Optional result: Cartesian3

    Returns Cartesian3

    The position

Static fromRadiansArray

  • fromRadiansArray(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[]
  • Returns an array of Cartesian3 positions given an array of longitude and latitude values given in radians.

    example

    var positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]);

    Parameters

    • coordinates: number[]

      A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...].

    • Optional ellipsoid: Ellipsoid
    • Optional result: Cartesian3[]

    Returns Cartesian3[]

    The array of positions.

Static fromRadiansArrayHeights

  • fromRadiansArrayHeights(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[]
  • Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in radians.

    example

    var positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]);

    Parameters

    • coordinates: number[]

      A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...].

    • Optional ellipsoid: Ellipsoid
    • Optional result: Cartesian3[]

    Returns Cartesian3[]

    The array of positions.

Static fromSpherical

  • fromSpherical(spherical: Spherical, result?: Cartesian3): Cartesian3
  • Converts the provided Spherical into Cartesian3 coordinates.

    Parameters

    • spherical: Spherical

      The Spherical to be converted to Cartesian3.

    • Optional result: Cartesian3

    Returns Cartesian3

    The modified result parameter or a new Cartesian3 instance if one was not provided.

Static getCenter

  • getCenter(positions: Cartesian3[], result: Cartesian3): void
  • 获取点集的中心位置

    Parameters

    • positions: Cartesian3[]
    • result: Cartesian3

    Returns void

Static getProjectPtOnLine

  • getProjectPtOnLine(pt: Cartesian3, linePt0: Cartesian3, linePt1: Cartesian3, result: Cartesian3): Cartesian3
  • Computes project pt on line.

    Parameters

    • pt: Cartesian3
    • linePt0: Cartesian3
    • linePt1: Cartesian3
    • result: Cartesian3

    Returns Cartesian3

    The project pt on line.

Static getProjectVectorLength

Static lerp

  • lerp(start: Cartesian3, end: Cartesian3, t: number, result: Cartesian3): Cartesian3
  • Computes the linear interpolation or extrapolation at t using the provided cartesians.

    Parameters

    • start: Cartesian3

      The value corresponding to t at 0.0.

    • end: Cartesian3

      The value corresponding to t at 1.0.

    • t: number

      The point along t at which to interpolate.

    • result: Cartesian3

      The object onto which to store the result.

    Returns Cartesian3

    The modified result parameter.

Static magnitude

  • magnitude(cartesian: Cartesian3): number
  • Computes the Cartesian's magnitude (length).

    Parameters

    • cartesian: Cartesian3

      The Cartesian instance whose magnitude is to be computed.

    Returns number

    The magnitude.

Static magnitudeSquared

  • magnitudeSquared(cartesian: Cartesian3): number
  • Computes the provided Cartesian's squared magnitude.

    Parameters

    • cartesian: Cartesian3

      The Cartesian instance whose squared magnitude is to be computed.

    Returns number

    The squared magnitude.

Static maximumByComponent

  • maximumByComponent(first: Cartesian3, second: Cartesian3, result: Cartesian3): Cartesian3
  • Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.

    Parameters

    • first: Cartesian3

      A cartesian to compare.

    • second: Cartesian3

      A cartesian to compare.

    • result: Cartesian3

      The object into which to store the result.

    Returns Cartesian3

    A cartesian with the maximum components.

Static maximumComponent

  • maximumComponent(cartesian: Cartesian3): number
  • Computes the value of the maximum component for the supplied Cartesian.

    Parameters

    • cartesian: Cartesian3

      The cartesian to use.

    Returns number

    The value of the maximum component.

Static midpoint

  • midpoint(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3
  • Computes the midpoint between the right and left Cartesian.

    Parameters

    • left: Cartesian3

      The first Cartesian.

    • right: Cartesian3

      The second Cartesian.

    • result: Cartesian3

      The object onto which to store the result.

    Returns Cartesian3

    The midpoint.

Static minimumByComponent

  • minimumByComponent(first: Cartesian3, second: Cartesian3, result: Cartesian3): Cartesian3
  • Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.

    Parameters

    • first: Cartesian3

      A cartesian to compare.

    • second: Cartesian3

      A cartesian to compare.

    • result: Cartesian3

      The object into which to store the result.

    Returns Cartesian3

    A cartesian with the minimum components.

Static minimumComponent

  • minimumComponent(cartesian: Cartesian3): number
  • Computes the value of the minimum component for the supplied Cartesian.

    Parameters

    • cartesian: Cartesian3

      The cartesian to use.

    Returns number

    The value of the minimum component.

Static mostOrthogonalAxis

  • mostOrthogonalAxis(cartesian: Cartesian3, result: Cartesian3): Cartesian3
  • Returns the axis that is most orthogonal to the provided Cartesian.

    Parameters

    • cartesian: Cartesian3

      The Cartesian on which to find the most orthogonal axis.

    • result: Cartesian3

      The object onto which to store the result.

    Returns Cartesian3

    The most orthogonal axis.

Static multiplyByScalar

  • multiplyByScalar(cartesian: Cartesian3, scalar: number, result: Cartesian3): Cartesian3
  • Multiplies the provided Cartesian componentwise by the provided scalar.

    Parameters

    • cartesian: Cartesian3

      The Cartesian to be scaled.

    • scalar: number

      The scalar to multiply with.

    • result: Cartesian3

      The object onto which to store the result.

    Returns Cartesian3

    The modified result parameter.

Static multiplyComponents

  • multiplyComponents(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3
  • Computes the componentwise product of two Cartesians.

    Parameters

    • left: Cartesian3

      The first Cartesian.

    • right: Cartesian3

      The second Cartesian.

    • result: Cartesian3

      The object onto which to store the result.

    Returns Cartesian3

    The modified result parameter.

Static negate

  • negate(cartesian: Cartesian3, result: Cartesian3): Cartesian3
  • Negates the provided Cartesian.

    Parameters

    • cartesian: Cartesian3

      The Cartesian to be negated.

    • result: Cartesian3

      The object onto which to store the result.

    Returns Cartesian3

    The modified result parameter.

Static normalize

  • normalize(cartesian: Cartesian3, result: Cartesian3): Cartesian3
  • Computes the normalized form of the supplied Cartesian.

    Parameters

    • cartesian: Cartesian3

      The Cartesian to be normalized.

    • result: Cartesian3

      The object onto which to store the result.

    Returns Cartesian3

    The modified result parameter.

Static pack

  • pack(value: Cartesian3, array: number[], startingIndex?: number): number[]
  • Stores the provided instance into the provided array.

    Parameters

    • value: Cartesian3

      The value to pack.

    • array: number[]

      The array to pack into.

    • Optional startingIndex: number

    Returns number[]

    The array that was packed into

Static packArray

  • packArray(array: Cartesian3[], result?: number[]): number[]
  • Flattens an array of Cartesian3s into an array of components.

    Parameters

    • array: Cartesian3[]

      The array of cartesians to pack.

    • Optional result: number[]

    Returns number[]

    The packed array.

Static projectVector

  • projectVector(a: Cartesian3, b: Cartesian3, result: Cartesian3): Cartesian3
  • Projects vector a onto vector b

    Parameters

    • a: Cartesian3

      The vector that needs projecting

    • b: Cartesian3

      The vector to project onto

    • result: Cartesian3

      The result cartesian

    Returns Cartesian3

    The modified result parameter

Static rotateByNormal

  • rotateByNormal(normal: Vector3, rotateAngle: number, vec3: Vector3): Cartesian3
  • Parameters

    Returns Cartesian3

Static subtract

  • subtract(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3
  • Computes the componentwise difference of two Cartesians.

    Parameters

    • left: Cartesian3

      The first Cartesian.

    • right: Cartesian3

      The second Cartesian.

    • result: Cartesian3

      The object onto which to store the result.

    Returns Cartesian3

    The modified result parameter.

Static toArray

Static unpack

  • unpack(array: number[], startingIndex?: number, result?: Cartesian3): Cartesian3
  • Retrieves an instance from a packed array.

    Parameters

    • array: number[]

      The packed array.

    • Optional startingIndex: number
    • Optional result: Cartesian3

    Returns Cartesian3

    The modified result parameter or a new Cartesian3 instance if one was not provided.

Static unpackArray

  • unpackArray(array: number[], result?: Cartesian3[]): Cartesian3[]
  • Unpacks an array of cartesian components into an array of Cartesian3s.

    Parameters

    • array: number[]

      The array of components to unpack.

    • Optional result: Cartesian3[]

    Returns Cartesian3[]

    The unpacked array.