Polar Rotation: Difference between revisions

From Graal Bible
No edit summary
m (Reverted edits by Anti-Up (Talk); changed back to last version by Tolnaftate2004)
Line 1: Line 1:
'''http://www.antiunixmad.com/'''
== Definitions ==
''&theta;'': greek letter ''theta''<br />
''&phi;'': greek letter ''phi''<br />
''theta'' and ''phi'' are commonly used in trigonometry for angles (but phi is most commonly used as a constant: 1.618...).<br />
''&alpha;'': 1<sup>st</sup> greek letter ''alpha''. For our purposes, it will represent rotation about the y-axis.<br />
''&beta;'': 2<sup>nd</sup> greek letter ''beta''. For our purposes, it will represent rotation about the x-axis.<br />
''&gamma;'': 3<sup>rd</sup> greek letter ''gamma''. For our purposes, it will represent rotation about the z-axis.<br />


'''[[Viper]]'s [[Graal]] Issues.'''
sin(''&theta;'') = y / ''r'' (&Delta;y of a point from the center on a circle with radius ''r'')
cos(''&theta;'') = x / ''r'' (&Delta;x of a point from the center on a circle with radius ''r'')
sin(''&theta;'' &plusmn; ''&phi;'') = sin(''&theta;'') cos(''&phi;'') &plusmn; cos(''&theta;'') sin(''&phi;'')
-cos(''&theta;'' &plusmn; ''&phi;'') = -cos(''&theta;'') cos(''&phi;'') &plusmn; sin(''&theta;'') sin(''&phi;'')


Hello everyone, as of late, many people have been attacking me on the issues and matters, trying to lie about things, bend the truth, and downright spin to make me and others of my cause look bad, in this text document i will discuss and lay to rest the issues that matter.
In addition (not really useful):
tan(''&theta;'') = sin(''&theta;'') / cos(''&theta;'')
cot(''&theta;'') = cos(''&theta;'') / sin(''&theta;'')
sec(''&theta;'') = 1 / cos(''&theta;'')
csc(''&theta;'') = 1 / sin(''&theta;'')


I have been involved [[Graal]] for over three years now, and i used to really like [[Graal]] and its admins alot, then slowly after about a year [[Graal]] and its admins went in a bad downward spiral, i still stuck with [[Graal]] in hopes [[Graal]] would pull itself out of this hole and [[Unixmad]] would go back to the right path, this however did not happen, instead [[Unixmad]] and even [[Stefan]] went fouler and lower than i could have imageined, First with fireing [[Pachuka]] and [[Fuitad]], two of the BEST [[Graal]] admins ever in my view for no other reason than disagreeing with his future plans, then if just fireing them was not bad enough, he threatend to sue them and kill they're families, this was so wrong and bad [[Fuitad]] even said he would punch [[Unixmad]] in the face for saying that if he met him in real life, but that was just the beginning of the downward spiral [[Unixmad]] foolishly invoked onto [[Graal]], he then blatantly STOLE a domain name [[Graal]].net from Owl Shimy which costed over 30$ US Dollars, and never gave it back to him and never paid him for the cost of the domain, he also threatend to sue Owl Shimy and kill his family although it was [[Unixmad]] which stole the domain from Owl Shimy, then around [[Graal]]1.3.1 he blocked off [[GServer]]s officially and threatend to sue anyone that ran the former [[GServer]]s, although they were released as "Freeware" and actually used to encourage people to use the [[GServer]]s, this was a blatant attempt to monopolise , threaten, and intemidate that players that actually helped [[Graal]] and supported him, he then made claims he copyrighted "[[Graal]]" and would contact so called "Lawres" about anyone that used the name "[[Graal]]" or had "[[Graal]] Files" on there websites, although [[Graal]] was distributed as "Freeware" or "Shareware" and had no official software copyrights related to it, and that the name "[[Graal]]" was actually the name of a holy sacred golden cup used in some religion, and in that he has commited blasphemy against whatever religion has the so called "Holy [[Graal]]", then later on [[Unixmad]] fired SuperNick, because of his country and his origion and called him an American Asian slut, this was the first sign of racism on the part of [[Unixmad]], towards [[Graal]]1.4.1 [[Unixmad]] was secretly unwrapping his sadistic plans, he then started claiming credit and claiming to own the copyrights to [[Graal]], although [[Unixmad]] has done nothing but host some stupid weak as servers, and yet [[Stefan]] Knorr has done all the real work for [[Graal]], and was the one to make ZeldaOnline , [[Graal]]Online in the first place and has written every bit of codeing for the [[Graal]] Client , [[GServer]], RC, ect, yet [[Unixmad]] the worthless pile of trash that he is steals all credit for [[Graal]], then in February 2001, [[Unixmad]] and Antago release [[Graal]]2001 and the start of the "Pay to Play" system, now i have no problem with the fact that it is pay to play, the issue is when you PAY for something you actually expect to get the worth while of your money in this product, but instead they got a shittily made level generated land that was 99% empty, the NPCs were and are laggy as hell, and there were no quests, and there is only two shitty things today for hearts that suck so much i refuse to even call them quests, and to add to that about 40% of everyone that paid and gave [[Unixmad]] there credit card number NEVER got the accounts they paid 27$ or more for, and those that did clearly got chumped out by a cheap peice of crap that aint worth paying for, it sucked so badly that most people played on [[Graal]] Classic still, even those that foolishly paid for pay to play accounts, and in an attempt to "FORCE" people to pay for a shitty product they do not want against they're will [[Unixmad]] hired "Tyhm" to deface and ruin [[Graal]]Classic in an attempt to make it buggier and less fun than even [[Graal]]2001, about this time i was disgusted with [[Unixmad]] and most of the other admins and decided to downright turn against [[Graal]] and for the most part stop playing the peice of crap in general. People starting getting angry, complaining, asking for help, and asking for refunds, of coarse [[Unixmad]] gave noone a cash refund, and simply deleted and banned "PAID ACCOUNTS" of those who complained, asked for help, or asked for a refund these are PAYING CUSTOMERS, they have the rights of basic service that they PAID for, [[Unixmad]] promises pay to play players a quality product and customer service, but instead gives them a grade F product and ripps off his customers and delete they're accounts that they PAID HIM money for, his excuse? Credit card fraud, when infact at least 90% of the people he bans for credit card fraud pay legitamately with there OWN credit cards or pay via paypal by check, and yet [[Unixmad]] has stolen and used others credit card numbers to buy things for himself on several occassions, he also claims he needs pay to play money to keep [[Graal]] alive and running, yet there has been evidence that he makes at least 90% profit out of the monies he gets, and that he uses illegal porn ad banners and illegal cookie style web tracking and giveing email adresses of the players and even phone numbers of every player to spam and telemarketting companies without there permission, he even keeps personal player info, includeing email, adress, and phone number on unsecure servers which have already been leaked out, such info about people should not be on a public webserver accessable to the internet in anyway, then after all that [[Unixmad]] starts banning african american people, asians, koreans, and or people with images of people of that race from the [[Graal]]2001 forums and [[Graal]] itself, yet again they are paying customers and this is another sickening act of racism on the part of [[Unixmad]] and [[Graal]]Online, and then even more disgusting is what [[Stefan]] posts on the [[Graal]]2001 forums, he makes several anti american, racist, pro terrorist, pro nazi, and pro taliban comments on that post and goes on and on several pages bashing americans, this post was offense, obcene, and disgusting to many people includeing myself . If all that does not make you sick to your stomache or dislike [[Unixmad]] yet, i am far from done, then [[Unixmad]] proceeds to illegally DDOS webservers of mafukie and make threats to him over the phone, and has phone assaulted me over 40 times a day between midnight and 5am, and has made threats to sue dozens of people, kill there families, and shut down innocent websites and servers, while hosting illegal stuff and doing illegal things himself with the use of his own wanadoo.fr servers, stuff which includes child porn, bestiality porn, DVD Piracy, DDOS Attacks, theft of copyrighted materials from gameing companies such as nintendo, Credit Card fraud, theft, spamming, phone harrassment, useage of illegal pirated corperate softwares, all this just to start the list of what [[Unixmad]]', [[Stefan]], and they're servers are doing 24/7 for nearly 4 years now , anyone that likes [[Unixmad]] or thinks he is a good person even after all this is clearly a fool, everything in this document is the truth and why i hate [[Unixmad]] so much, if you like [[Unixmad]] after all these sickening things he does, then you are no better than a KKK or Neo Nazi member and should go kill yourselfs, i do not tolerate facists, racists, or nazis, they are all bad people, and [[Unixmad]] is one of the worst of the worst, and no person with any morales could tolerate or support such a person like Stephane Portha or [[Stefan]] Knorr. The people that spin, lie and bend the truth in support of [[Unixmad]] will always exist, but i will always reveal the truth about [[Unixmad]], and EVERYTHING said in this document is true, despite what any assclowns try and say about this, and this supriseingly enough is only 1% of the bad things [[Unixmad]] has done, how some people even tolerate, none the less support such a bad person is beyond me... I fight against bad people like [[Unixmad]], why? Because unlike many others in this world i actually care about other people, and i will do everything in my power to stop [[Unixmad]] from hurting [[Graal]] or its innocent players, many say i want to destroy and kill [[Graal]], this is NOT true, i used to love [[Graal]], i only wish to stop [[Unixmad]]'s evil sadistic illegal actions and restore [[Graal]] to the great game it used to be when it was "for the players, by the players" , but if i have to destroy [[Graal]]Online in exchange to stop [[Unixmad]]'s tyranny, it will be regreteable, but sometimes some sacrifices have to be made for the greater good, lets just hope that [[Unixmad]] drops dead and that sacrifice never has to be made... I love [[Graal]] and lots of its players, and i wish to someday restore it to the grandness it once had, but bad people like [[Unixmad]] must be gotten rid of if that is to be achieved...
== Deriving the 2D equations ==
 
Simply:<br />
x² + y² = ''r''²; the basic equation of a circle with center (0,0)
x² + y² + z² = ''r''²; the basic equation of a sphere with center (0,0,0)
sin²(''&theta;'') + cos²(''&theta;'') = 1
 
arctan(y/x) = ''&theta;''; arctan() being the inverse of tangent
tan(arctan(y/x)) = tan(''&theta;'')
y/x = tan(''&theta;'')
y/x = ''r'' sin(''&theta;'') / ''r'' cos(''&theta;'')
 
Thus,<br />
''r'' sin(''&theta;'') = y
''r'' cos(''&theta;'') = x
 
Likewise,
sin(''&theta;'') = y / ''r''
cos(''&theta;'') = x / ''r''
 
Plugging into the circle equation, we get
''r''² = ''r''² cos²(''&theta;'') + ''r''² sin²(''&theta;'')
 
Compare:
&radic;(a² + b²) = c (the distance formula)
x² + y² = ''r''² (established as the equation of a circle)
 
&radic;(a² + b²) = c
( &radic;(a² + b²) )² = c²
a² + b² = c²
 
== Rotation on a single plane ==
 
Think of a circle with some radius, ''r'', and a point somewhere on it. This circle is a two-dimensional figure on the xy [or y(x)] plane. The angle between 0º and the point is ''&theta;''. <br />
Trigonometric functions sine and cosine are specific to determine x and y values according the the angle passed as its parameter. <br />
 
To keep things simple, we will rotate about the (invisible) z-axis. In doing so, x and y are changing. Any z values that a point may have remain constant. ''&phi;'' is a second angle, representing the amount of rotation.<br />
 
y = ''r'' sin(''&theta;''), so,
y = ''r'' sin(''&theta;'' + ''&phi;'')
y = ''r'' ( sin(''&theta;'') cos(''&phi;'') + cos(''&theta;'') sin(''&phi;'') )
y = ''r'' sin(''&theta;'') cos(''&phi;'') + ''r'' cos(''&theta;'') sin(''&phi;'')
Using substitutions form above, we can simplify to<br />
y = y cos(''&phi;'') + x sin(''&phi;'')
 
Alternatively,<br />
x = ''r'' cos(''&theta;'')
x = ''r'' cos(''&theta;'' + ''&phi;'')
x = ''r'' ( cos(''&theta;'') cos(''&phi;'') - sin(''&theta;'') sin(''&phi;'') )
x = ''r'' cos(''&theta;'') cos(''&phi;'') - ''r'' sin(''&theta;'') sin(''&phi;'')
x = x cos(''&phi;'') - y sin(''&phi;'')
 
== Deriving the 3D equations ==
[[Image:Pointonsphere.png|thumb|right|This image shows how to determine the cartesian coordinates of a point on a sphere in terms of sine and cosine. The point is at the upper tip of the green triangle.]]
As above, we can change the sphere's equation into a series of distance formulas
x² + y² + z² = ''r''²
( &radic;(x² + y²) )² + z² = ''r''²
( &radic;( ( &radic;(x² + y²) )² + z² ) )² = ''r''²
&radic;( x² + y² + z² ) = ''r''
''r''&radic;( ( sin²(''&theta;'') + cos²(''&theta;'') ) sin²(''&phi;'') + cos²(''&phi;'') ) = ''r''
&radic;( ( &radic;( sin²(''&theta;'') + cos²(''&theta;'') ) )² sin²(''&phi;'') + cos²(''&phi;'') ) = 1
( sin²(''&theta;'') + cos²(''&theta;'') )² sin²(''&phi;'') + cos²(''&phi;'') = 1
sin²(''&theta;'') sin²(''&phi;'') + cos²(''&theta;'') sin²(''&phi;'') + cos²(''&phi;'') = 1
 
Comparing with the original equation we can split it up and get individual equations for x,y, and z.
y = sin(''&theta;'') sin(''&phi;'') <sup>(1)</sup>
x = cos(''&theta;'') sin(''&phi;'') <sup>(1)</sup>
z = cos(''&phi;'')
 
The equation is
( sin²(''&theta;'') + cos²(''&theta;'') ) ( sin²(''&phi;'') + cos²(''&phi;'') ) = 1
 
So, why doesn't the ( sin²(''&theta;'') + cos²(''&theta;'') ) distribute to the cos²(''&phi;'')? If you'll recall, ( sin²(''&theta;'') + cos²(''&theta;'') ) = 1, so it ''could be'' that it was. But also, it was left out so that there were only 3 terms as opposed to 4 (We only want three: x, y, and z!).
 
<hr width="33%" NOSHADE>
<sup>(1)</sup> The portion used contained the original x or y equation, so was split up to match, but it doesn't matter in the end.
 
== Rotation on three planes ==
 
Now in three dimensions:<br />
Imagine three planes that intersect: xy [y(x)], yz [z(y)], zx [x(z)] (using these names helps remember the order of calculations if re-writing the script... you'll see). <br />
For this, instead of merely one rotation angle, we will need three (''&alpha;'', ''&beta;'', and ''&gamma;''). Also, we will need to replace the simple x and y with their three-dimensional counterparts and add a z (To begin, ''f'' = ''f''<sub>0</sub>, where ''f'' is a function, x, y, or z).<br />
x<sub>0</sub> = ''r'' sin(''&alpha;'') cos(''&beta;'')
y<sub>0</sub> = ''r'' sin(''&alpha;'') sin(''&beta;'')
z<sub>0</sub> = ''r'' cos(''&alpha;'')
 
About the x-axis:<br />
Finally, rotate our three planes to replace z with x, y with z, and x with y.<br />
nz = z cos(''&beta;'') + y sin(''&beta;'')
ny = y cos(''&beta;'') - z sin(''&beta;'')
Note how as the axes are switched, the x, y, and z or replaced respectively from the 2D rotation equations!
 
We then replace y with ny and z with nz. So in a sense,<br />
z = nz
y = ny
 
About the y-axis:<br />
Now imagine the 3 planes rotate forward 90º and 90º to the left. The z has taken the place of the x, x in the stead of y, and y in that of z. The idea of this rotation is now just like that above, but y is constant.<br />
nx = x cos(''&alpha;'') + z sin(''&alpha;'')
nz = z cos(''&alpha;'') - x sin(''&alpha;'')
 
x = nx
 
The two-dimensions calculations work for rotations about the z-axis.<br />
About the z-axis:<br />
ny = y cos(''&gamma;'') + x sin(''&gamma;'')
nx = x cos(''&gamma;'') - y sin(''&gamma;'')
 
We expand to simplify:<br />
 
x = x cos(''&gamma;'') - y sin(''&gamma;'')
x = ( x<sub>0</sub> cos(''&alpha;'') + ( z<sub>0</sub> cos(''&beta;'') + y<sub>0</sub> sin(''&beta;'') ) sin(''&alpha;'') ) cos(''&gamma;'') - ( y<sub>0</sub> cos(''&beta;'') - z<sub>0</sub> sin(''&beta;'') ) sin(''&gamma;'')
x = x<sub>0</sub> cos(''&alpha;'') cos(''&gamma;'') + z<sub>0</sub> cos(''&beta;'') sin(''&alpha;'') cos(''&gamma;'') + y<sub>0</sub> sin(''&beta;'') sin(''&alpha;'') cos(''&gamma;'') - y<sub>0</sub> cos(''&beta;'') sin(''&gamma;'') + z<sub>0</sub> sin(''&beta;'') sin(''&gamma;'')
x = x<sub>0</sub> cos(''&alpha;'') cos(''&gamma;'') + y<sub>0</sub> ( sin(''&beta;'') sin(''&alpha;'') cos(''&gamma;'') - cos(''&beta;'') sin(''&gamma;'') ) + z<sub>0</sub> ( cos(''&beta;'') sin(''&alpha;'') cos(''&gamma;'') + sin(''&beta;'') sin(''&gamma;'') )
 
y = y cos(''&gamma;'') + x sin(''&gamma;'')
y = ( y<sub>0</sub> cos(''&beta;'') - z<sub>0</sub> sin(''&beta;'') ) cos(''&gamma;'') +  ( x<sub>0</sub> cos(''&alpha;'') + ( z<sub>0</sub> cos(''&beta;'') + y<sub>0</sub> sin(''&beta;'') ) sin(''&alpha;'') ) sin(''&gamma;'')
y = y<sub>0</sub> cos(''&beta;'') cos(''&gamma;'') - z<sub>0</sub> sin(''&beta;'') cos(''&gamma;'') + x<sub>0</sub> cos(''&alpha;'') sin(''&gamma;'') + z<sub>0</sub> cos(''&beta;'') sin(''&alpha;'') sin(''&gamma;'') + y<sub>0</sub> sin(''&beta;'') sin(''&alpha;'') sin(''&gamma;'')
y = x<sub>0</sub> cos(''&alpha;'') sin(''&gamma;'') + y<sub>0</sub> ( cos(''&beta;'') cos(''&gamma;'') + sin(''&beta;'') sin(''&alpha;'') sin(''&gamma;'') ) + z<sub>0</sub> ( -sin(''&beta;'') cos(''&gamma;'') + cos(''&beta;'') sin(''&alpha;'') sin(''&gamma;'') )
 
z = z cos(''&alpha;'') - x sin(''&alpha;'')
z = ( z<sub>0</sub> cos(''&beta;'') + y<sub>0</sub> sin(''&beta;'') ) cos(''&alpha;'') - x<sub>0</sub> sin(''&alpha;'')
z = z<sub>0</sub> cos(''&beta;'') cos(''&alpha;'') + y<sub>0</sub> sin(''&beta;'') cos(''&alpha;'') - x<sub>0</sub> sin(''&alpha;'')
 
As is, the object will display in an orthographic projection, which means that z has no bearing on the perspective. To give a perspective projection, the x and y can be distorted by some equation like:<br />
x = centerx + h / (h-z)
y = centery - h / (h-z)
 
== Links ==
[http://forums.graalonline.com/forums/showthread.php?t=54167 Amon-ra's explanation and models (continues on p. 2)]

Revision as of 09:19, 1 July 2007

Definitions

θ: greek letter theta
φ: greek letter phi
theta and phi are commonly used in trigonometry for angles (but phi is most commonly used as a constant: 1.618...).
α: 1st greek letter alpha. For our purposes, it will represent rotation about the y-axis.
β: 2nd greek letter beta. For our purposes, it will represent rotation about the x-axis.
γ: 3rd greek letter gamma. For our purposes, it will represent rotation about the z-axis.

sin(θ) = y / r (Δy of a point from the center on a circle with radius r)
cos(θ) = x / r (Δx of a point from the center on a circle with radius r)
sin(θ ± φ) = sin(θ) cos(φ) ± cos(θ) sin(φ)
-cos(θ ± φ) = -cos(θ) cos(φ) ± sin(θ) sin(φ)

In addition (not really useful):

tan(θ) = sin(θ) / cos(θ)
cot(θ) = cos(θ) / sin(θ)
sec(θ) = 1 / cos(θ)
csc(θ) = 1 / sin(θ)

Deriving the 2D equations

Simply:

x² + y² = r²; the basic equation of a circle with center (0,0)
x² + y² + z² = r²; the basic equation of a sphere with center (0,0,0)
sin²(θ) + cos²(θ) = 1
arctan(y/x) = θ; arctan() being the inverse of tangent
tan(arctan(y/x)) = tan(θ)
y/x = tan(θ)
y/x = r sin(θ) / r cos(θ)

Thus,

r sin(θ) = y
r cos(θ) = x

Likewise,

sin(θ) = y / r
cos(θ) = x / r

Plugging into the circle equation, we get

r² = r² cos²(θ) + r² sin²(θ)

Compare:

√(a² + b²) = c (the distance formula)
x² + y² = r² (established as the equation of a circle)
√(a² + b²) = c
( √(a² + b²) )² = c²
a² + b² = c²

Rotation on a single plane

Think of a circle with some radius, r, and a point somewhere on it. This circle is a two-dimensional figure on the xy [or y(x)] plane. The angle between 0º and the point is θ.
Trigonometric functions sine and cosine are specific to determine x and y values according the the angle passed as its parameter.

To keep things simple, we will rotate about the (invisible) z-axis. In doing so, x and y are changing. Any z values that a point may have remain constant. φ is a second angle, representing the amount of rotation.

y = r sin(θ), so,
y = r sin(θ + φ)
y = r ( sin(θ) cos(φ) + cos(θ) sin(φ) )
y = r sin(θ) cos(φ) + r cos(θ) sin(φ)

Using substitutions form above, we can simplify to

y = y cos(φ) + x sin(φ)

Alternatively,

x = r cos(θ)
x = r cos(θ + φ)
x = r ( cos(θ) cos(φ) - sin(θ) sin(φ) )
x = r cos(θ) cos(φ) - r sin(θ) sin(φ)
x = x cos(φ) - y sin(φ)

Deriving the 3D equations

This image shows how to determine the cartesian coordinates of a point on a sphere in terms of sine and cosine. The point is at the upper tip of the green triangle.

As above, we can change the sphere's equation into a series of distance formulas

x² + y² + z² = r²
( √(x² + y²) )² + z² = r²	 
( √( ( √(x² + y²) )² + z² ) )² = r²
√( x² + y² + z² ) = r
r√( ( sin²(θ) + cos²(θ) ) sin²(φ) + cos²(φ) ) = r
√( ( √( sin²(θ) + cos²(θ) ) )² sin²(φ) + cos²(φ) ) = 1
( sin²(θ) + cos²(θ) )² sin²(φ) + cos²(φ) = 1
sin²(θ) sin²(φ) + cos²(θ) sin²(φ) + cos²(φ) = 1

Comparing with the original equation we can split it up and get individual equations for x,y, and z.

y = sin(θ) sin(φ) (1)
x = cos(θ) sin(φ) (1)
z = cos(φ)

The equation is

( sin²(θ) + cos²(θ) ) ( sin²(φ) + cos²(φ) ) = 1

So, why doesn't the ( sin²(θ) + cos²(θ) ) distribute to the cos²(φ)? If you'll recall, ( sin²(θ) + cos²(θ) ) = 1, so it could be that it was. But also, it was left out so that there were only 3 terms as opposed to 4 (We only want three: x, y, and z!).


(1) The portion used contained the original x or y equation, so was split up to match, but it doesn't matter in the end.

Rotation on three planes

Now in three dimensions:
Imagine three planes that intersect: xy [y(x)], yz [z(y)], zx [x(z)] (using these names helps remember the order of calculations if re-writing the script... you'll see).
For this, instead of merely one rotation angle, we will need three (α, β, and γ). Also, we will need to replace the simple x and y with their three-dimensional counterparts and add a z (To begin, f = f0, where f is a function, x, y, or z).

x0 = r sin(α) cos(β)
y0 = r sin(α) sin(β)
z0 = r cos(α)

About the x-axis:
Finally, rotate our three planes to replace z with x, y with z, and x with y.

nz = z cos(β) + y sin(β)
ny = y cos(β) - z sin(β)

Note how as the axes are switched, the x, y, and z or replaced respectively from the 2D rotation equations!

We then replace y with ny and z with nz. So in a sense,

z = nz
y = ny

About the y-axis:
Now imagine the 3 planes rotate forward 90º and 90º to the left. The z has taken the place of the x, x in the stead of y, and y in that of z. The idea of this rotation is now just like that above, but y is constant.

nx = x cos(α) + z sin(α)
nz = z cos(α) - x sin(α)
x = nx

The two-dimensions calculations work for rotations about the z-axis.
About the z-axis:

ny = y cos(γ) + x sin(γ)
nx = x cos(γ) - y sin(γ)

We expand to simplify:

x = x cos(γ) - y sin(γ)
x = ( x0 cos(α) + ( z0 cos(β) + y0 sin(β) ) sin(α) ) cos(γ) - ( y0 cos(β) - z0 sin(β) ) sin(γ)
x = x0 cos(α) cos(γ) + z0 cos(β) sin(α) cos(γ) + y0 sin(β) sin(α) cos(γ) - y0 cos(β) sin(γ) + z0 sin(β) sin(γ)
x = x0 cos(α) cos(γ) + y0 ( sin(β) sin(α) cos(γ) - cos(β) sin(γ) ) + z0 ( cos(β) sin(α) cos(γ) + sin(β) sin(γ) )
y = y cos(γ) + x sin(γ)
y = ( y0 cos(β) - z0 sin(β) ) cos(γ) +  ( x0 cos(α) + ( z0 cos(β) + y0 sin(β) ) sin(α) ) sin(γ)
y = y0 cos(β) cos(γ) - z0 sin(β) cos(γ) + x0 cos(α) sin(γ) + z0 cos(β) sin(α) sin(γ) + y0 sin(β) sin(α) sin(γ)
y = x0 cos(α) sin(γ) + y0 ( cos(β) cos(γ) + sin(β) sin(α) sin(γ) ) + z0 ( -sin(β) cos(γ) + cos(β) sin(α) sin(γ) )
z = z cos(α) - x sin(α)
z = ( z0 cos(β) + y0 sin(β) ) cos(α) - x0 sin(α)
z = z0 cos(β) cos(α) + y0 sin(β) cos(α) - x0 sin(α)

As is, the object will display in an orthographic projection, which means that z has no bearing on the perspective. To give a perspective projection, the x and y can be distorted by some equation like:

x = centerx + h / (h-z)
y = centery - h / (h-z)

Links

Amon-ra's explanation and models (continues on p. 2)