JSCAD User Group
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    vec3.angle(a,b)

    Scheduled Pinned Locked Moved Development Discussions
    3 Posts 2 Posters 1.5k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • sopattS Offline
      sopatt
      last edited by sopatt

      Hello,

      I am new to jscad. I was using OpenSCAD and didn't know about jscad until recently but I'm loving it.

      On to my comment:

      vec3.angle(a, b) returns the angle using acos. Because acos(-x) = acos(x) it returns the absolute value of the angle, i.e. it leaves out the direction. Maybe the absolute angle is useful but my use case is to roll geometry from a to b, so I want not only the magnitude but the direction. I can still get it another way.

      But thank you for all the hard work.

      z3devZ 2 Replies Last reply Reply Quote 0
      • z3devZ Offline
        z3dev @sopatt
        last edited by

        @sopatt Thanks for the feedback.

        FYI, Most computations are based upon the glMatrix library (glmatrix.net)

        I will double check but this is probably the same functionality as glmatrix.

        1 Reply Last reply Reply Quote 0
        • z3devZ Offline
          z3dev @sopatt
          last edited by

          @sopatt Sorry to the late reply.

          You probably already know this but an ''orientation" is required to determine the rotation, and sign of the angle.

          This is probably the best implementation out there. And if you want then this could be added to the vec3 functions.

          https://stackoverflow.com/questions/5188561/signed-angle-between-two-3d-vectors-with-same-origin-within-the-same-plane

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          Powered by NodeBB | Contributors