Skip to content

Bug in BaseChangeMatrix, TransformFromCoordSys, TransformToCoordSys #236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/Spatial/Euclidean/CoordinateSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ public CoordinateSystem BaseChangeMatrix
get
{
var matrix = Build.DenseOfColumnVectors(XAxis.ToVector(), YAxis.ToVector(), ZAxis.ToVector());
var cs = new CoordinateSystem(this);
cs.SetRotationSubMatrix(matrix.Transpose());
return cs;
var baseCs = new CoordinateSystem();
baseCs.SetRotationSubMatrix(matrix.Transpose());
return baseCs;
}
}

Expand Down Expand Up @@ -256,7 +256,7 @@ public static CoordinateSystem Rotation(Angle angle, Vector3D v)
/// <returns>A rotated coordinate system</returns>
public static CoordinateSystem Rotation(Angle yaw, Angle pitch, Angle roll)
{
var cs = new CoordinateSystem();
var cs = new CoordinateSystem();
var cosY = yaw.Cos;
var sinY = yaw.Sin;
var cosP = pitch.Cos;
Expand All @@ -276,7 +276,7 @@ public static CoordinateSystem Rotation(Angle yaw, Angle pitch, Angle roll)
cs[1, 2] = sinY * sinP * cosR - cosY * sinR;
cs[2, 2] = cosP * cosR;

return cs;
return cs;
}
/// <summary>
/// Rotates around Z
Expand Down Expand Up @@ -354,7 +354,7 @@ public static CoordinateSystem Translation(Vector3D translation)
/// <summary>
/// Creates a rotating coordinate system
/// </summary>
/// <param name="r">A 3�3 matrix with the rotation portion</param>
/// <param name="r">A 3�3 matrix with the rotation portion</param>
/// <param name="coordinateSystem">A rotated coordinate system</param>
/// <returns>A rotating coordinate system</returns>
public static CoordinateSystem SetRotationSubMatrix(Matrix<double> r, CoordinateSystem coordinateSystem)
Expand Down