Giter VIP home page Giter VIP logo

Comments (4)

ErikWahlstrom avatar ErikWahlstrom commented on June 18, 2024

Can you share some code that shows the error behavior?

from mathnet-spatial.

zorandragan avatar zorandragan commented on June 18, 2024

@ErikWahlstrom

Here is the test. The matrices are the same, although the CSY was rotated twice around the Y axis.
`CoordinateSystem testCSY = new CoordinateSystem(new Point3D(400, 500, 600), new UnitVector3D(1, 0, 0), new UnitVector3D(0, 1, 0), new UnitVector3D(0, 0, 1));

Angle alpha = new Angle(90, new Degrees());

//Rotates around Y
testCSY = CoordinateSystem.Pitch(alpha);

Matrix rotMatrix1st = CoordinateSystem.GetRotationSubMatrix(testCSY);

//Rotates around Y again
testCSY = CoordinateSystem.Pitch(alpha);

Matrix rotMatrix2nd = CoordinateSystem.GetRotationSubMatrix(testCSY);

bool eq = false;

for (int i = 0; i < 3; i++)

for (int j = 0; j < 3; j++)

    eq = rotMatrix1st.Storage.At(i, j) == rotMatrix2nd.Storage.At(i, j);     

Assert.IsTrue(eq, "Matrices are equal");`

from mathnet-spatial.

ErikWahlstrom avatar ErikWahlstrom commented on June 18, 2024

@zorandragan
Not sure if I entirely understand your intention but I think you are using it wrong (at least from how the API is designed now). Pitch is a static method which returns a new immutable coordinate system each time. So in order to Pitch it 2 times alpha you would want to do CoordinateSystem.Pitch(alpha * 2) for the second coordinatesystem. If you want multiple rotations (yaw, pitch roll) you can use CoordinateSystem.Rotation(yaw, pitch, roll).

from mathnet-spatial.

zorandragan avatar zorandragan commented on June 18, 2024

@ErikWahlstrom
I see now that I was using it wrong. I need a CSY that can have a "state", but for that I guess I would need to create my own wrapper class. Thanks very much for the support.

from mathnet-spatial.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.