# Papervision atomic math

**URL:** <https://forum.kirupa.com/t/papervision-atomic-math/279845>\
**Category:** Uncategorized\
**Created:** [January 19, 2009, 10:34pm UTC](https://forum.kirupa.com/t/papervision-atomic-math/279845 "2009-01-19T22:34:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![malidia](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/malidia/32/684_2.png) [@malidia](https://forum.kirupa.com/u/malidia)\
**Post date:** [January 19, 2009, 10:34pm UTC](https://forum.kirupa.com/t/papervision-atomic-math/279845/1 "2009-01-19T22:34:18Z")

</div>

So i have been trying to explore with papervision and i ran into either a math problem i can’t figure out (i really do need to bone up on math as a future goal) or something papervision rotation properties are doing that I am not prepared for either way I am trying to find someone to school me because i am apparently making no progress talking to myself.

So the project is just me simulating something like an atom where an orb spins around another orb, the problem i am having lies in a movieclip plane with a flat circle drawn in it, and i want to place that plane within the path the orb is spinning, thus making it look like a graphical orbit.

the code i am being tripped up at is commented out below

```auto
this._theta = limitToPI(this._theta+this._xVelocity);
this._phi = limitToPI(this._phi+this._zVelocity)

this._node.x = this._rho * Math.sin(this._phi) * Math.cos(this._theta);
this._node.y = this._rho * Math.sin(this._phi) * Math.sin(this._theta);
this._node.z = this._rho * Math.cos(this._phi);
            
this._orbit.rotationX = 90-(this._phi * 180/Math.PI);
//this._orbit.rotationY = (this._theta * 180/Math.PI);
//this._orbit.rotationZ = (this._theta * 180/Math.PI);
            
render();

```

here is a jpeg of what i am trying to achieve roughly sketched out  
[http://troyblank.com/temp/3DplanedisectProb/projectedPath.gif](http://troyblank.com/temp/3DplanedisectProb/projectedPath.gif)

and here is the swf you can see the above code running  
[http://troyblank.com/temp/3DplanedisectProb/deploy/AtomicMotion.swf](http://troyblank.com/temp/3DplanedisectProb/deploy/AtomicMotion.swf)

and here is the source in fla and as files  
[http://troyblank.com/temp/3DplanedisectProb/AtomicMotion.zip](http://troyblank.com/temp/3DplanedisectProb/AtomicMotion.zip)

here is what i am using to get me formulas:  
[http://www.flashandmath.com/mathlets/multicalc/coords/shilmay23fin.html](http://www.flashandmath.com/mathlets/multicalc/coords/shilmay23fin.html)
