There are several different approaches to this problem. It all depends what kind of spiral do you want. I decided to start with conical spiral and then build up from there.
Parametric equation of conical spiral is
`x=t r cos(a t)`
`y=t r sin(a t)`
`z=t`
where `a` is the angular frequency and `r` is the radius.
Since the shape of the spiral doesn't matter we'll put `a=r=1.`
Thus, we get
`x=t cos t`
`y=t sin t`
`z=t`
See the first image.
The spiral starts at `(0,0,0)` but then starts to spread out to infinity. We want to make it fall back to the axis at `(100,0,0).` To do that we will replace `t` in front of sine and cosine with sine function making the radius oscillate. Thus we get
`x=10 sin ((pi t)/100) cos t`
`y=10 sin ((pi t)/100)sin t`
`z=t`
`pi/100` is here to make sure that the period is `100/2` and 10 is here just to make the spiral prettier.
For this spiral see the second image.
Now comes the tricky part. we want to rotate the spiral so that it passes not through `(100,0,0)` but through `(100,100,100).` It may be easier to think in terms of unit vectors. We want to rotate vector `(1,0,0)` so that we get vector `(1/sqrt3,1/sqrt3,1/sqrt3)` (unit vector in direction of `(100,100,100)`). So we basically need to rotate around vector `(-1,1,0)` by angle `arccos(1/sqrt3)` (angle between `(1,0,0)` and `(1/sqrt3,1/sqrt3,1/sqrt3)`). To do that we'll find the rotation matrix (see the link below).
The rotation matrix is
`[[1/6 (3 + qrt3), 1/6 (-3 + sqrt3), 1/sqrt3],[1/6 (-3 + sqrt3), 1/6 (3 + sqrt3), 1/sqrt3],[-(1/sqrt3), -(1/sqrt3), 1/sqrt3]]`
Now we just multiply that matrix with
`(10 sin ((pi t)/(100sqrt3)) cos t,10 sin ((pi t)/(100sqrt3))sin t,t)` vector from our previous spiral but with extended period by a factor of `sqrt3` because the distance between (0,0,0) and (100,100,100) si greater than distance between (0,0,0) and (100,0,0).
The final equation is
`x=1/3(sqrt3t+5((3+sqrt3)cos t+(sqrt3-3)sin t)sin((pi t)/(100sqrt3)))`
`y=1/3(sqrt3t+5((sqrt3-3)cos t+(3+sqrt3)sin t)sin((pi t)/(100sqrt3)))`
`z=1/sqrt3(t-10(cos t+sin t)sin((pi t)/(100sqrt3)))`
The spiral can be seen in the third image.
There is probably some easier way of constructing the required spiral, but i couldn't think of any.
No comments:
Post a Comment