Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
rotate a vector and points
otaolafr
Member Posts: 113 EDU
Answers
var myTransform = rotationAround(myLine, 30 * degree);
var newPoint = myTransform * (vector(1, 2, 3) * meter);
trying this :(point1 and 2 are previously defined)
it needed a unit. thanks!
thanks anyway
using point and vector would be fantastic.
Thank you.
I tried
coneAngleRotation = rotationAround(rotationAxis, angle);
normalize(toPlaneNormal = coneAngleRotation * (toPlaneNormal * meter)
in order to rotate the unitless direction vector "toPlaneNormal". This doesn't work because in this multiplication the vector is interpreted as a point rather than a direction. It'll give an outcome, but it depends on the units chosen and isn't what you're intending. So best to create a line and rotate it that way:
coneAngleRotation = rotationAround(rotationAxis, angle);
var toPlaneNormalLine = line(point, toPlaneNormal);
toPlaneNormalLine = coneAngleRotation * toPlaneNormalLine;
toPlaneNormal = toPlaneNormalLine.direction;
note: this vector transform only works in the proper order: transform * vector.