Git Product home page Git Product logo

Comments (3)

dlegland avatar dlegland commented on May 27, 2024

Hi,

The rotation in the supporting plane of the ellipse (ie, around the normal) is specified by a third angle called PSI.

The transformation from a point on the ellipse to the 3D point is given by the succession of transforms:

  • initialize x = R1 * cos(t) and y = R2 * sin(t) (standard ellipse parameterization), and set z = 0.
  • apply a rotation by PSI around the Z axis
  • apply a rotation by THETA around the Y axis
  • apply a rotation by PHI around the Z axis
  • apply a 3D translation to replace the ellipse around its center

Hope this helps !

from matgeom.

oqilipo avatar oqilipo commented on May 27, 2024

Thanks, that helped me.

But another problem arose.

Is there an unambiguous way to extract PSI, THETA, PHI from a 3x3 rotation matrix?
I've used:
angles3d3 = rad2deg(rotm2eul(R','ZYZ'));
THETA = -angles3d3(2);
PHI = -angles3d3(3);
PSI = angles3d3(1);
but in some case the correct solution is PSI and in the other it's 180°-PSI.

Thanks a lot.

from matgeom.

dlegland avatar dlegland commented on May 27, 2024

Hi,
From what I remember, it is difficult to keep a perfect one-to-one mapping between euler angles and rotation matrix. Moreover, I could not find clear consensus on conventions for angle order or sign...

Two hints:

  • if theta is larger than 180 degrees, this could cause ambiguities. By digging into files, it seems I used theta within [0 180] degrees as convention.
  • It is not always clear which of PSI or PHI is applied first. Sometimes swapping them makes things better...

The code can be found in "geom3d/private/localToGlobal3d".

regards,

from matgeom.

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.