/// <summary> /// Writes a value for the <c>direction</c> property as a <c>unitCartesian</c> value. The <c>direction</c> property specifies the direction of the vector. /// </summary> /// <param name="value">The value.</param> public void WriteDirectionPropertyUnitCartesian(UnitCartesian value) { using (var writer = OpenDirectionProperty()) { writer.WriteUnitCartesian(value); } }
/// <summary> /// Writes the value expressed as a <code>unitCartesian</code>, which is the axis specified as a three-dimensional unit magnitude Cartesian value `[X, Y, Z]`, in world coordinates. /// </summary> /// <param name="value">The value.</param> public void WriteUnitCartesian(UnitCartesian value) { const string PropertyName = UnitCartesianPropertyName; OpenIntervalIfNecessary(); Output.WritePropertyName(PropertyName); CesiumWritingHelper.WriteUnitCartesian3(Output, value); }
/// <summary> /// Initializes a set of <see cref="UnitSpherical"/> coordinates from the provided set of <see cref="UnitCartesian"/> coordinates. /// </summary> /// <param name="coordinates">The set of UnitCartesian coordinates.</param> public UnitSpherical(UnitCartesian coordinates) { double x = coordinates.X; double y = coordinates.Y; double z = coordinates.Z; double radialSquared = x * x + y * y; m_clock = Math.Atan2(y, x); m_cone = Math.Atan2(Math.Sqrt(radialSquared), z); }
/// <summary> /// Forms a diagonal matrix from the input unit vector. /// </summary> /// <param name="vector">The vector.</param> /// <returns>The diagonal matrix.</returns> public static Matrix3By3 DiagonalMatrix(UnitCartesian vector) { return(DiagonalMatrix(vector.X, vector.Y, vector.Z)); }
/// <summary> /// Forms a <see cref="Matrix3By3"/> from the input vector such that the result of the cross product of the input unit vector /// with another vector is equivalent to pre-multiplying the other vector by the returned matrix. /// </summary> /// <param name="vector">The unit vector for which the cross product equivalent matrix is desired.</param> /// <returns>The cross product equivalent matrix.</returns> public static Matrix3By3 CrossProductEquivalentMatrix(UnitCartesian vector) { return(new Matrix3By3(0.0, -vector.Z, vector.Y, vector.Z, 0.0, -vector.X, -vector.Y, vector.X, 0.0)); }