Skip to main content
28 votes
Accepted

How to speed up `RotationMatrix`?

Having this problem so often, I also generated some tools to handle it which I'd like to share. This is the code (along with a usage message which is basically a small modification of ...
Henrik Schumacher's user avatar
26 votes

How to roll a graph on the y-axis

We calculate the tangent vector of parametric curve {t^2,t} and the ArcLength from 0 to <...
cvgmt's user avatar
  • 79.7k
16 votes
Accepted

How to animate an impossible image

Edit To get the original picture orientation,we can add π to θ. ...
cvgmt's user avatar
  • 79.7k
14 votes

How to roll a graph on the y-axis

Assuming you mean roll as in the way a circle rolls across the floor, you need a unit speed arc-length parameterization of the curve $(t^2,t)$. Why? Becuase the key behavior of rolling is no ...
Adam's user avatar
  • 3,986
13 votes

Generating Mesh of Rotated Graphics

As an alternative you can use BoundaryElementMeshRotate (and a few other Boolean operations) for boundary element meshes that are part of the FEMAddOns paclet. The ...
user21's user avatar
  • 40.4k
11 votes

Converting a rotation matrix to a quaternion

I needed to do this recently, so I broke down and decided to write routines for interconverting quaternions and rotation matrices. I'll give the quaternion to rotation matrix routine first, since it'...
J. M.'s missing motivation's user avatar
11 votes
Accepted

Solving for Euler Angles

As noted, you can use FindGeometricTransform[] in tandem with EulerAngles[]: ...
J. M.'s missing motivation's user avatar
11 votes

Generating Mesh of Rotated Graphics

I think the failure to discretize your first Graphics object is a bug. But, instead of creating graphics objects and then converting them to ...
Carl Woll's user avatar
  • 131k
9 votes

How to rotate 3D ellipsoid with built-in functions?

TransformedRegion[] can quickly determine the rotated ellipsoid: ...
J. M.'s missing motivation's user avatar
9 votes

How to speed up `RotationMatrix`?

I have previously used the following routine based on ideas by Möller and Hughes in these previous answers, but it would be good to have it as an explicit answer here: ...
J. M.'s missing motivation's user avatar
9 votes
Accepted

Multiply vectors in a matrix by a matrix

You can actually use Dot directly. It works in unintuitive ways with tensors. ...
Kiro's user avatar
  • 1,531
9 votes

Why the rotation degree of flow field is different from the angle specified by `RotationMatrix` function

That is not a problem with Mathematica. Rather a fundamental one in your approach: you're not transforming points, but rather vectors: You need to rotate the input, and then also the output, because ...
SHuisman's user avatar
  • 3,501
9 votes
Accepted

How can I make an animation when using RevolutionPlot3D?

Edit animate axis is the rotation axis, we can set axis={0,0,1} or axis={1,0,0} etc. ...
cvgmt's user avatar
  • 79.7k
9 votes
Accepted

How to rotate a triangle to get this picture?

A starting point. ...
cvgmt's user avatar
  • 79.7k
8 votes
Accepted

Rotating Vectors in space

I think you want a single transformation function for all points, rather than one for each point independently as kglr's answer currently shows. ...
8 votes
Accepted

How to rotate a lattice points about an arbitrary axis

...
kglr's user avatar
  • 399k
8 votes
Accepted

The inverse problem of rotation of stress matrix

So the problem is as follows: Given two symmetric matrices A and B, find a rotation R that ...
Henrik Schumacher's user avatar
8 votes

Maintaining shape size while rotating in GraphicsGrid

Translate a circle to the same location. Set the color of the circle to White and you will have what you are looking for. I am sure there are more formal solutions ...
Syed's user avatar
  • 56.2k
8 votes
Accepted

Reverse the rotation of an animated gif and create a mirror image of it

To keep same speed for GIF import its "DisplayDurations": dur = Import["/Users/Vitaliy/Desktop/wheel.gif", "DisplayDurations"] And ...
Vitaliy Kaurov's user avatar
7 votes

Axis/Angle from rotation matrix

Here is a slightly shorter re-implementation of Jens's method, which uses the "Pixar method" (itself a modification of Frisvad's method) to generate an orthogonal basis: ...
J. M.'s missing motivation's user avatar
7 votes

Manipulate - performance during 3D rotation

This answers the slowness part. It is slow because you are using exact numbers for degrees and the matrix was not packed then. Compare the timing: Before: After Just change this one line: ...
Nasser's user avatar
  • 149k
7 votes

Finding optimal rotation matrix

RotationMatrix ...
rhermans's user avatar
  • 37k
7 votes
Accepted

What is the meaning of this code section?

This code defines a function, #4 Boole[Norm[({x, y} - #1).RotationMatrix[#3]/#2]^2 < 1] & applies it to each element of ...
bbgodfrey's user avatar
  • 62k
7 votes
Accepted

Vectors do not define a plane when constructing a RotationMatrix

Edit Another way is use perturbation. u = {0, 1, 0}; v = {0, -1, 0}; m = Limit[RotationMatrix[{u, v + t*RandomInteger[20, 3]}], t -> 0] ...
cvgmt's user avatar
  • 79.7k
7 votes
Accepted

Maintaining shape size while rotating in GraphicsGrid

The different sizes are created by the unnecessary "GraphicsGrid" that scales the different pictures. Without it: ...
Daniel Huber's user avatar
  • 54.6k
7 votes

Maintaining shape size while rotating in GraphicsGrid

Specify ImageSize in each Graphics using the (still undocumented) syntax ...
kglr's user avatar
  • 399k
7 votes
Accepted

How can I rotate a cube uniformly?

By choosing three uniformly distributed angles for generating the rotation matrix you do not end up with a uniformly distributed rotation matrix. See also this link. You need to choose non-uniformly ...
Mathias's user avatar
  • 629
7 votes
Accepted

How to make a ParametricPlot3D curve rotate smoothly?

The use of Dynamic below keeps the ParametricPlot from reevaluating, which leads to smooth behavior: ...
Michael E2's user avatar
  • 241k
7 votes

Rotation of area

Method-1 We integrate the circles whose center is on the line y=1 and radius is the distant from the point to the line ...
cvgmt's user avatar
  • 79.7k
7 votes
Accepted

How can I get a 3D form when rotate the polygon $ABCD$ around the line $AB$

Similar with https://mathematica.stackexchange.com/a/301459/72111 Calculate the volume. ...
cvgmt's user avatar
  • 79.7k

Only top scored, non community-wiki answers of a minimum length are eligible