POV-Ray : Newsgroups : povray.off-topic : Urk.. This is why I hate complex math... : Re: Urk.. This is why I hate complex math... Server Time
29 Jul 2024 00:34:31 EDT (-0400)
  Re: Urk.. This is why I hate complex math...  
From: Patrick Elliott
Date: 27 Aug 2012 18:01:46
Message: <503bee4a$1@news.povray.org>
On 8/26/2012 6:17 PM, waggy wrote:
> However, I'm still not certain if I'm thinking about the same problem you are.
> Are you trying to come up with an exact symbolic solution, perhaps so you can
> design a control system? Or, do you just need a reasonable numerical
> approximation, perhaps just for animation?
>

Hmm. First, its for simulation. I want to create the illusion that a 
large underground complex was built, and by large I mean "really large", 
and it is rotating around a center, and someone built a tram system in 
it. So, no, this isn't real world, its entirely simulated, and won't 
even be using real phsyics (hell if it was, I wouldn't need to compute 
all this myself.. They don't even have a "curve" based movement system, 
you can feed in the "rotation" and "location" data now, to define where 
something should be at each point, but you have to "precompute" the 
results. Hell, I have an experimental system that does that already, 
using a curve that "fits" the control points, it just uses more script 
resources to do it, so causes more lag in the simulator. Apparently, 
basic curve math is either too confusing for them, or they actually 
think it makes sense to waste script memory storing 500 data points, and 
the needed rotations, instead of computing them for you. Though, I 
admit, the one hickup I have been still trying to work out why my 
version is taking the last point, and the next, and figuring out what 
the proper change in rotation needed to be. I don't remember if I ever 
actually figured that one out...

To clarify how the thing needs to work though, lets set this up. Imagine 
a huge "platform", say 250 meters each direction. This platform is 
rotating around its center. The "track" is set up on this rotating 
platform. The tram itself is suspended from a single rail, and due to 
the limitations of the kinematics in the system I am using, it ***can't 
have*** more than one direction of movement, or at least not if its like 
the image you linked, which is an actual car design. If it was set up 
as, say, a two seated thing, this would be different, since there would 
only be one point of suspension. For my case, I have two attachment 
points, and since I can't hinge any other points, its limited to side to 
side movement, as you describe.

So, what I am looking for is the angle that the pendulum has swung to, 
depending on the "external" motion of the platform, as it applies to the 
side to side motion, and the motion induced by turns taken by the tram. 
Changes in forward motion, such as slowing down and speeding up, won't 
have an effect, in principle. In fact, I don't think it has an effect at 
all, since the only thing it could do is counter the motion of the 
centrifugal forces, or increase them, in the forward direction, and 
since there is no rotation in that direction...

Now.. Functions available -

I have vectors, so all the "math" can be handled without having to 
monkey too much with non-matrix math, unless I have to. Its also easier 
to leave things as they are, since its using quaternions.

I can get the location of the tram, at that time, its rotation, as well 
as computing:

Rotation to Axis: VectorNormal(a.x,a.y,a.z) * (1 | -(a.s <0))

Rotation to Angle: ACos(Abs(a.s)) / Sqrt(a.x^2 + a.y^2 + a.z^2 + a.s^2)) * 2

Axis Angle to Rotation: axis = VectorNormal(axis) * Sin( angle / 2) 
{returns- axis & Cos(angle/2)

Rotation to Left: VectorNormal(<0, 1, 0> * q)

Rotation to Forward: VectorNormal(<1, 0, 0> * q)

Rotation to Up: VectorNormal(<0, 0, 1> * q)

Vector Normal

Angle Between: 2 * ACos((a.x * b.x + a.y * b.y + a.z * b.z + a.s * b.s) 
/ Sqrt((a.x * a.x + a.y * a.y + a.z * a.z + a.s * a.s) * (b.x * b.x + 
b.y * b.y + b.z * b.z + b.s * b.s)))

Rotation Between: Umm. Complication and not a single equation. It also 
bugs out, if the rotations are nearly opposite of each other.

It might be nice to also have the math for something that actually can 
wobble in more than one axis, on the off chance a short "point to point" 
zip line like thing was needed some place, but that isn't something I 
had planned for, and I could live without it.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.