DynamoVisualProgramming.ZeroTouchLibrary by Autodesk

<PackageReference Include="DynamoVisualProgramming.ZeroTouchLibrary" Version="2.1.0-beta6460" />

 Vector

public class Vector : DesignScriptEntity
public double Length { get; }

Get the length of the vector - otherwise known as the Euclidean norm

public double X { get; }

Get the X component of a Vector

public double Y { get; }

Get the Y component of a Vector

public double Z { get; }

Get the Z component of a Vector

public static Vector ByCoordinates(double x = 0, double y = 0, double z = 0)

Form a Vector by 3 Euclidean coordinates

public static Vector ByCoordinates(double x = 0, double y = 0, double z = 0, bool normalized = false)

Form a Vector by 3 Euclidean coordinates and normalize the Vector

public static Vector ByTwoPoints(Point start, Point end)

Form a Vector by two end points. The result is a vector from the start to the end point.

public static Vector XAxis()

Get the canonical X axis Vector (1,0,0)

public static Vector YAxis()

Get the canonical Y axis Vector (0,1,0)

public static Vector ZAxis()

Get the canonical Z axis Vector (0,0,1)

public Vector Add(Vector vectorToAdd)

Add a vector

public double AngleAboutAxis(Vector otherVector, Vector rotationAxis)

Returns the angle between the two Vectors, in the range [0, 360] degrees. It uses axis of rotation to determine the direction of the angle.

public double AngleBetween(Vector otherVector)

Returns the angle between the two Vectors, in the range [0, 180] degrees.

public double AngleBetween(Vector otherVector, Vector rotationAxis)

Returns the angle between the two Vectors, in the range [0, 360] degrees. It uses axis of rotation to determine the direction of the angle.

public double AngleWithVector(Vector otherVector)

Returns the angle between the two Vectors, in the range [0, 180] degrees.

public Point AsPoint()

Get the Point with the same X, Y, and Z component

public Vector Cross(Vector cross)

Form the cross product of two vectors

public double Dot(Vector vec)

Form the dot product of two vectors

public bool IsAlmostEqualTo(Vector other)

Determine whether two vectors ae almost equal

public bool IsParallel(Vector other)

Determine whether two vectors are parallel or not

public Vector Normalized()

Get the normalized version of a vector

public Vector Reverse()

Get the reverse of the vector. Essentially this negates the X, Y, and Z components of the Vector.

public Vector Rotate(Vector axis, double degrees = 0)

Rotates a Vector around an axis by a specified number of degrees

public Vector Rotate(Plane plane, double degrees = 0)

Rotates a vector around the Plane origin and normal by a specified degree

public Vector Scale(double scale_factor = 1)

Scale Vector uniformly around the origin

public Vector Scale(double xScaleFactor = 1, double yScaleFactor = 1, double zScaleFactor = 1)

Scale Vector non-uniformly around the origin

public Vector Subtract(Vector vectorToSubtract)

Subtract a vector

Transform this Vector by input CoordinateSystem matrix.