JSCAD User Group

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    vec3.angle(a,b)

    Development Discussions
    2
    3
    1311
    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.
    • sopatt
      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.

      z3dev 2 Replies Last reply Reply Quote 0
      • z3dev
        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
        • z3dev
          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
          • First post
            Last post
          Powered by NodeBB | Contributors