Jump to content

Rotate from (0,1,0) to (0,-1,0) with dihedral


Recommended Posts

There is dihedral vex and hscriptExpression functions to calculate rotations.

How to rotate for example from (0,-1,0) to (0,1,0), when angle between vectors is 180°.

I can parse vangle hscriptExpression function result with if statement, but what is correct decision ?

Edited by Alexey Vanzhula
Link to comment
Share on other sites

dihedral will compute rotation from {0,-1,0} to {0,1,0} with no problems

the only catch is that there is infinite number of possible rotations between opposite vectors as there is no rotation axis strictly defined as in the case when those vectors are not parallel

so you need to define perpendicular axis to these vectors to rotate about if you really care about exact rotation

 

so once you have your perpendicular axis you can just use

rotaxis() expression function

or

quaternion(angleaxis) or quaternion(angle, axis) or rotate() VEX functions

 

to get your desired rotation

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...