Last active
May 13, 2021 03:31
-
-
Save chuongmep/119f1e7004b7049937914c7750a4298a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Return DotProduct of two Vector | |
/// </summary> | |
/// <param name="vector"></param> | |
/// <param name="other"></param> | |
/// <returns></returns> | |
public static double Dot(Autodesk.DesignScript.Geometry.Vector vector, | |
Autodesk.DesignScript.Geometry.Vector other) | |
{ | |
return vector.X * other.X + vector.Y * other.Y + vector.Z * other.Z; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Obtains the dot product of two vectors. | |
/// </summary> | |
/// <param name="u">Vector3.</param> | |
/// <param name="v">Vector3.</param> | |
/// <returns>The dot product.</returns> | |
public static double DotProduct(this XYZ u, XYZ v) | |
{ | |
return u.X * v.X + u.Y * v.Y + u.Z * v.Z; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment