@JsType(isNative=true, namespace="Cesium", name="Cartesian4") public class Cartesian4 extends Object implements Packable
Cartesian2
,
Cartesian3
Modifier and Type | Field and Description |
---|---|
static int |
packedLength
The number of elements used to pack the object into an array.
|
double |
w
The W component
Default Value: 0.0
|
double |
x
The X component.
|
double |
y
The Y component.
|
double |
z
The Z component.
|
Constructor and Description |
---|
Cartesian4()
A 3D Cartesian point.
|
Cartesian4(double x,
double y,
double z,
double w)
A 3D Cartesian point.
|
Modifier and Type | Method and Description |
---|---|
static Cartesian4 |
abs(Cartesian4 cartesian,
Cartesian4 result)
Computes the absolute value of the provided Cartesian.
|
static Cartesian4 |
add(Cartesian4 left,
Cartesian4 right,
Cartesian4 result)
Computes the componentwise sum of two Cartesians.
|
Cartesian4 |
clone()
Duplicates this Cartesian4 instance.
|
Cartesian4 |
clone(Cartesian4 result)
Duplicates this Cartesian4 instance.
|
static Cartesian4 |
clone(Cartesian4 cartesian,
Cartesian4 result)
Duplicates a Cartesian4 instance.
|
static double |
distance(Cartesian4 left,
Cartesian4 right)
Computes the distance between two points.
|
static double |
distanceSquared(Cartesian4 left,
Cartesian4 right)
Computes the squared distance between two points.
|
static Cartesian4 |
divideByScalar(Cartesian4 cartesian,
double scalar,
Cartesian4 result)
Divides the provided Cartesian componentwise by the provided scalar.
|
static Cartesian4 |
divideComponents(Cartesian4 left,
Cartesian4 right,
Cartesian4 result)
Computes the componentwise quotient of two Cartesians.
|
static double |
dot(Cartesian4 left,
Cartesian4 right)
Computes the dot (scalar) product of two Cartesians.
|
Cartesian4 |
equals(Cartesian4 right)
Compares this Cartesian against the provided Cartesian componentwise and returns true if they are equal, false otherwise.
|
static boolean |
equals(Cartesian4 left,
Cartesian4 right)
Compares the provided Cartesians componentwise and returns true if they are equal, false otherwise.
|
static boolean |
equalsEpsilon(Cartesian4 left,
Cartesian4 right,
double relativeEpsilon,
double absoluteEpsilon)
Compares the provided Cartesians componentwise and returns true if they pass an absolute or relative tolerance test, false otherwise.
|
boolean |
equalsEpsilon(Cartesian4 right,
double relativeEpsilon,
double absoluteEpsilon)
Compares this Cartesian against the provided Cartesian componentwise and returns true if they pass an absolute or
relative tolerance test, false otherwise.
|
static Cartesian4 |
fromArray(double[] array)
Creates a Cartesian4 from two consecutive elements in an array.
|
static Cartesian4 |
fromArray(double[] array,
Cartesian4 result)
Creates a Cartesian4 from two consecutive elements in an array.
|
static Cartesian4 |
fromArray(double[] array,
int startingIndex)
Creates a Cartesian4 from two consecutive elements in an array.
|
static Cartesian4 |
fromArray(double[] array,
int startingIndex,
Cartesian4 result)
Creates a Cartesian4 from two consecutive elements in an array.
|
static Cartesian4 |
fromColor(Color color)
Creates a Cartesian4 instance from a Color. red, green, blue, and alpha map to x, y, z, and w, respectively.
|
static Cartesian4 |
fromColor(Color color,
Cartesian4 result)
Creates a Cartesian4 instance from a Color. red, green, blue, and alpha map to x, y, z, and w, respectively.
|
static Cartesian4 |
fromElements(double x,
double y,
double z,
double w)
Creates a Cartesian4 instance from x and y coordinates.
|
static Cartesian4 |
fromElements(double x,
double y,
double z,
double w,
Cartesian4 result)
Creates a Cartesian4 instance from x and y coordinates.
|
static Cartesian4 |
lerp(Cartesian4 start,
Cartesian4 end,
double t)
Computes the linear interpolation or extrapolation at t using the provided cartesians.
|
static Cartesian4 |
lerp(Cartesian4 start,
Cartesian4 end,
double t,
Cartesian4 result)
Computes the linear interpolation or extrapolation at t using the provided cartesians.
|
static double |
magnitude(Cartesian4 cartesian)
Computes the Cartesian's magnitude (length).
|
static double |
magnitudeSquared(Cartesian4 cartesian)
Computes the provided Cartesian's squared magnitude.
|
static Cartesian4 |
maximumByComponent(Cartesian4 first,
Cartesian4 second)
Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
|
static Cartesian4 |
maximumByComponent(Cartesian4 first,
Cartesian4 second,
Cartesian4 result)
Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
|
static double |
maximumComponent(Cartesian4 cartesian)
Computes the value of the maximum component for the supplied Cartesian.
|
static Cartesian4 |
minimumByComponent(Cartesian4 first,
Cartesian4 second)
Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
|
static Cartesian4 |
minimumByComponent(Cartesian4 first,
Cartesian4 second,
Cartesian4 result)
Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
|
static double |
minimumComponent(Cartesian4 cartesian)
Computes the value of the minimum component for the supplied Cartesian.
|
static Cartesian4 |
mostOrthogonalAxis(Cartesian4 cartesian)
Returns the axis that is most orthogonal to the provided Cartesian.
|
static Cartesian4 |
mostOrthogonalAxis(Cartesian4 cartesian,
Cartesian4 result)
Returns the axis that is most orthogonal to the provided Cartesian.
|
static Cartesian4 |
multiplyByScalar(Cartesian4 cartesian,
double scalar)
Multiplies the provided Cartesian componentwise by the provided scalar.
|
static Cartesian4 |
multiplyByScalar(Cartesian4 cartesian,
double scalar,
Cartesian4 result)
Multiplies the provided Cartesian componentwise by the provided scalar.
|
static Cartesian4 |
multiplyComponents(Cartesian4 left,
Cartesian4 right)
Computes the componentwise product of two Cartesians.
|
static Cartesian4 |
multiplyComponents(Cartesian4 left,
Cartesian4 right,
Cartesian4 result)
Computes the componentwise product of two Cartesians.
|
static Cartesian4 |
negate(Cartesian4 cartesian)
Negates the provided Cartesian.
|
static Cartesian4 |
negate(Cartesian4 cartesian,
Cartesian4 result)
Negates the provided Cartesian.
|
static Cartesian4 |
normalize(Cartesian4 cartesian)
Computes the normalized form of the supplied Cartesian.
|
static Cartesian4 |
normalize(Cartesian4 cartesian,
Cartesian4 result)
Computes the normalized form of the supplied Cartesian.
|
static double[] |
pack(Cartesian4 value)
Stores the provided instance into the provided array.
|
static double[] |
pack(Cartesian4 value,
double[] array,
int startingIndex)
Stores the provided instance into the provided array.
|
static double[] |
packArray(Cartesian4[] array)
Flattens an array of Cartesian4s into and array of components.
|
static double[] |
packArray(Cartesian4[] array,
double[] result)
Flattens an array of Cartesian4s into and array of components.
|
static Cartesian4 |
subtract(Cartesian4 left,
Cartesian4 right)
Computes the componentwise difference of two Cartesians.
|
static Cartesian4 |
subtract(Cartesian4 left,
Cartesian4 right,
Cartesian4 result)
Computes the componentwise difference of two Cartesians.
|
String |
toString()
Creates a string representing this Cartesian in the format '(x, y, z, w)'.
|
static Cartesian4 |
UNIT_W()
An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 1.0).
|
static Cartesian4 |
UNIT_X()
An immutable Cartesian4 instance initialized to (1.0, 0.0, 0.0, 0.0).
|
static Cartesian4 |
UNIT_Y()
An immutable Cartesian4 instance initialized to (0.0, 1.0, 0.0, 0.0).
|
static Cartesian4 |
UNIT_Z()
An immutable Cartesian4 instance initialized to (0.0, 0.0, 1.0, 0.0).
|
static Cartesian4 |
unpack(double[] array)
Retrieves an instance from a packed array.
|
static Cartesian4 |
unpack(double[] array,
int startingIndex,
Cartesian4 result)
Retrieves an instance from a packed array.
|
static Cartesian4[] |
unpackArray(com.google.gwt.core.client.JsArrayNumber array)
Unpacks an array of cartesian components into and array of Cartesian4s.
|
static Cartesian4[] |
unpackArray(com.google.gwt.core.client.JsArrayNumber array,
Cartesian4[] result)
Unpacks an array of cartesian components into and array of Cartesian4s.
|
static Cartesian4 |
ZERO()
An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 0.0).
|
@JsProperty public double x
@JsProperty public double y
@JsProperty public double z
@JsProperty public double w
@JsProperty public static int packedLength
@JsConstructor public Cartesian4()
Cartesian2
,
Cartesian3
@JsConstructor public Cartesian4(double x, double y, double z, double w)
x
- The X component. Default Value: 0.0y
- The Y component. Default Value: 0.0z
- The Z component. Default Value: 0.0w
- The W component. Default Value: 0.0Cartesian2
,
Cartesian3
@JsProperty(name="UNIT_X") public static Cartesian4 UNIT_X()
@JsProperty(name="UNIT_Y") public static Cartesian4 UNIT_Y()
@JsProperty(name="UNIT_Z") public static Cartesian4 UNIT_Z()
@JsProperty(name="UNIT_W") public static Cartesian4 UNIT_W()
@JsProperty(name="ZERO") public static Cartesian4 ZERO()
@JsMethod public Cartesian4 clone(Cartesian4 result)
result
- The object onto which to store the result. Optional.@JsMethod public Cartesian4 clone()
@JsMethod public Cartesian4 equals(Cartesian4 right)
right
- The right hand side Cartesian. Optional.@JsMethod public boolean equalsEpsilon(Cartesian4 right, double relativeEpsilon, double absoluteEpsilon)
right
- The right hand side Cartesian. Optional.relativeEpsilon
- The relative epsilon tolerance to use for equality testing.absoluteEpsilon
- The absolute epsilon tolerance to use for equality testing. Optional.@JsMethod public String toString()
@JsMethod public static Cartesian4 abs(Cartesian4 cartesian, Cartesian4 result)
cartesian
- The Cartesian whose absolute value is to be computed.result
- The object onto which to store the result.@JsMethod public static Cartesian4 add(Cartesian4 left, Cartesian4 right, Cartesian4 result)
left
- The first Cartesian.right
- The second Cartesian.result
- The object onto which to store the result.@JsMethod public static Cartesian4 clone(Cartesian4 cartesian, Cartesian4 result)
cartesian
- The Cartesian to duplicate.result
- The object onto which to store the result. Optional.@JsMethod public static double distance(Cartesian4 left, Cartesian4 right)
Example:
// Returns 1.0
double d = Cartesian4.distance(new Cartesian4(1.0, 0.0, 0.0, 0.0), new Cartesian4(2.0, 0.0, 0.0, 0.0));
left
- The first point to compute the distance from.right
- The second point to compute the distance to.@JsMethod public static double distanceSquared(Cartesian4 left, Cartesian4 right)
Example:
// Returns 4.0, not 2.0
double d = Cartesian4.distanceSquared(new Cartesian4(1.0, 0.0, 0.0, 0.0), new Cartesian4(3.0, 0.0, 0.0, 0.0));
left
- The first point to compute the distance from.right
- The second point to compute the distance to.@JsMethod public static Cartesian4 divideByScalar(Cartesian4 cartesian, double scalar, Cartesian4 result)
cartesian
- The Cartesian to be divided.scalar
- The scalar to divide by.result
- The object onto which to store the result.@JsMethod public static Cartesian4 divideComponents(Cartesian4 left, Cartesian4 right, Cartesian4 result)
left
- The first Cartesian.right
- The second Cartesian.result
- The object onto which to store the result.@JsMethod public static double dot(Cartesian4 left, Cartesian4 right)
left
- The first Cartesian.right
- The second Cartesian.@JsMethod public static boolean equals(Cartesian4 left, Cartesian4 right)
left
- The first Cartesian. Optional.right
- The second Cartesian. Optional.@JsMethod public static boolean equalsEpsilon(Cartesian4 left, Cartesian4 right, double relativeEpsilon, double absoluteEpsilon)
left
- The first Cartesian. Optional.right
- The second Cartesian. Optional.relativeEpsilon
- The relative epsilon tolerance to use for equality testing.absoluteEpsilon
- The absolute epsilon tolerance to use for equality testing. Optional.@JsMethod public static Cartesian4 fromArray(double[] array, Cartesian4 result)
Example:
// Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0)
double[] v = {1.0, 2.0, 3.0, 4.0};
Cartesian4 p = Cartesian4.fromArray(v);
// Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array
double[] v2 = {0.0, 0.0, 1.0, 2.0, 3.0, 4.0};
Cartesian4 p2 = Cartesian4.fromArray(v2, 2);
array
- The array whose two consecutive elements correspond to the x and y components, respectively.result
- The object onto which to store the result. Optional.@JsMethod public static Cartesian4 fromArray(double[] array)
Example:
// Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0)
double[] v = {1.0, 2.0, 3.0, 4.0};
Cartesian4 p = Cartesian4.fromArray(v);
// Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array
double[] v2 = {0.0, 0.0, 1.0, 2.0, 3.0, 4.0};
Cartesian4 p2 = Cartesian4.fromArray(v2, 2);
array
- The array whose two consecutive elements correspond to the x and y components, respectively.@JsMethod public static Cartesian4 fromArray(double[] array, int startingIndex, Cartesian4 result)
Example:
// Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0)
double[] v = {1.0, 2.0, 3.0, 4.0};
Cartesian4 p = Cartesian4.fromArray(v);
// Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array
double[] v2 = {0.0, 0.0, 1.0, 2.0, 3.0, 4.0};
Cartesian4 p2 = Cartesian4.fromArray(v2, 2);
array
- The array whose two consecutive elements correspond to the x and y components, respectively.startingIndex
- The offset into the array of the first element, which corresponds to the x component. Optional.result
- The object onto which to store the result. Optional.@JsMethod public static Cartesian4 fromArray(double[] array, int startingIndex)
Example:
// Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0)
double[] v = {1.0, 2.0, 3.0, 4.0};
Cartesian4 p = Cartesian4.fromArray(v);
// Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array
double[] v2 = {0.0, 0.0, 1.0, 2.0, 3.0, 4.0};
Cartesian4 p2 = Cartesian4.fromArray(v2, 2);
array
- The array whose two consecutive elements correspond to the x and y components, respectively.startingIndex
- The offset into the array of the first element, which corresponds to the x component. Optional.@JsMethod public static Cartesian4 fromColor(Color color, Cartesian4 result)
color
- The source color.result
- The object onto which to store the result. Otional.@JsMethod public static Cartesian4 fromColor(Color color)
color
- The source color.@JsMethod public static Cartesian4 fromElements(double x, double y, double z, double w)
x
- The x coordinate.y
- The y coordinate.z
- The z coordinate.w
- The w coordinate.@JsMethod public static Cartesian4 fromElements(double x, double y, double z, double w, Cartesian4 result)
x
- The x coordinate.y
- The y coordinate.z
- The z coordinate.w
- The w coordinate.result
- Cartesian4 optional The object onto which to store the result.@JsMethod public static Cartesian4 lerp(Cartesian4 start, Cartesian4 end, double t)
start
- The value corresponding to t at 0.0.end
- The value corresponding to t at 1.0.t
- The point along t at which to interpolate.@JsMethod public static Cartesian4 lerp(Cartesian4 start, Cartesian4 end, double t, Cartesian4 result)
start
- The value corresponding to t at 0.0.end
- The value corresponding to t at 1.0.t
- The point along t at which to interpolate.result
- The object onto which to store the result.@JsMethod public static double magnitude(Cartesian4 cartesian)
cartesian
- The Cartesian instance whose magnitude is to be computed.@JsMethod public static double magnitudeSquared(Cartesian4 cartesian)
cartesian
- The Cartesian instance whose squared magnitude is to be computed.@JsMethod public static Cartesian4 maximumByComponent(Cartesian4 first, Cartesian4 second)
first
- A cartesian to compare.second
- A cartesian to compare.@JsMethod public static Cartesian4 maximumByComponent(Cartesian4 first, Cartesian4 second, Cartesian4 result)
first
- A cartesian to compare.second
- A cartesian to compare.result
- The object into which to store the result.@JsMethod public static double maximumComponent(Cartesian4 cartesian)
cartesian
- The cartesian to use.@JsMethod public static Cartesian4 minimumByComponent(Cartesian4 first, Cartesian4 second)
first
- A cartesian to compare.second
- A cartesian to compare.@JsMethod public static Cartesian4 minimumByComponent(Cartesian4 first, Cartesian4 second, Cartesian4 result)
first
- A cartesian to compare.second
- A cartesian to compare.result
- The object into which to store the result.@JsMethod public static double minimumComponent(Cartesian4 cartesian)
cartesian
- The cartesian to use.@JsMethod public static Cartesian4 mostOrthogonalAxis(Cartesian4 cartesian)
cartesian
- The Cartesian on which to find the most orthogonal axis.@JsMethod public static Cartesian4 mostOrthogonalAxis(Cartesian4 cartesian, Cartesian4 result)
cartesian
- The Cartesian on which to find the most orthogonal axis.result
- The object onto which to store the result.@JsMethod public static Cartesian4 multiplyByScalar(Cartesian4 cartesian, double scalar)
cartesian
- The Cartesian to be scaled.scalar
- The scalar to multiply with.@JsMethod public static Cartesian4 multiplyByScalar(Cartesian4 cartesian, double scalar, Cartesian4 result)
cartesian
- The Cartesian to be scaled.scalar
- The scalar to multiply with.result
- The object onto which to store the result.@JsMethod public static Cartesian4 multiplyComponents(Cartesian4 left, Cartesian4 right)
left
- The first Cartesian.right
- The second Cartesian.@JsMethod public static Cartesian4 multiplyComponents(Cartesian4 left, Cartesian4 right, Cartesian4 result)
left
- The first Cartesian.right
- The second Cartesian.result
- The object onto which to store the result.@JsMethod public static Cartesian4 negate(Cartesian4 cartesian)
cartesian
- The Cartesian to be negated.@JsMethod public static Cartesian4 negate(Cartesian4 cartesian, Cartesian4 result)
cartesian
- The Cartesian to be negated.result
- The object onto which to store the result.@JsMethod public static Cartesian4 normalize(Cartesian4 cartesian)
cartesian
- The Cartesian to be normalized.@JsMethod public static Cartesian4 normalize(Cartesian4 cartesian, Cartesian4 result)
cartesian
- The Cartesian to be normalized.result
- The object onto which to store the result.@JsMethod public static double[] pack(Cartesian4 value)
value
- The value to pack.@JsMethod public static double[] pack(Cartesian4 value, double[] array, int startingIndex)
value
- The value to pack.array
- The array to pack into.startingIndex
- The index into the array at which to start packing the elements. Optional.@JsMethod public static double[] packArray(Cartesian4[] array)
array
- The array of cartesians to pack.@JsMethod public static double[] packArray(Cartesian4[] array, double[] result)
array
- The array of cartesians to pack.result
- The array onto which to store the result.@JsMethod public static Cartesian4 subtract(Cartesian4 left, Cartesian4 right)
left
- The first Cartesian.right
- The second Cartesian.@JsMethod public static Cartesian4 subtract(Cartesian4 left, Cartesian4 right, Cartesian4 result)
left
- The first Cartesian.right
- The second Cartesian.result
- The object onto which to store the result.@JsMethod public static Cartesian4 unpack(double[] array)
array
- The packed array.@JsMethod public static Cartesian4 unpack(double[] array, int startingIndex, Cartesian4 result)
array
- The packed array.startingIndex
- The starting index of the element to be unpacked. Optional. Default 0.result
- The object into which to store the result. Optional.@JsMethod public static Cartesian4[] unpackArray(com.google.gwt.core.client.JsArrayNumber array)
array
- The array of components to unpack.@JsMethod public static Cartesian4[] unpackArray(com.google.gwt.core.client.JsArrayNumber array, Cartesian4[] result)
array
- The array of components to unpack.result
- The array onto which to store the result.Copyright © 2019. All rights reserved.