Originally posted by Raz_001
This isn't supposed to help anyone in particular, just anything that may be useful to anyone goes in here.
This isn't supposed to help anyone in particular, just anything that may be useful to anyone goes in here.
of course, this will not handle rotation...if you want that, there was a post a while back.code:
xm=(insert x movement code here);
ym=(insert x movement code here);
zm=(insert x movement code here);
zoom=1/z;
pixel:
x=(x+xm)*zoom;
y=(y+ym)*zoom;
NOte: my first experiment without smiley's *I smile*code:
So, here's the deal:
suppose x=.8 and y=.6, then the position of point point would be:
y-axis
^
|
|P Q
|.6- - - - - - -.(.8,.6)
| |
| |
|S |R
x-axis <- - - - - - - - - - - - - - - - >
|(0,0) .8
|
|
|
|
|
|
(this is an approximate figure)
PQRS is the quadrilaeral formed.
Now, we have to find l(SQ) or d(S,Q)
I will solve this as we solve our geomtery problems,
as this will give you a more clear idea.
Given:
1) line x is perpendicaular to line y.
2) d(S,R)=.8 , d(P,S)=.6
3) seg PQ is perpendicular to line y & seg RQ is perpendicular to line x.
to find: d(S,Q) i.e length of seg SQ.
Construction: Draw seg SQ ( I could'nt draw it here ) .
Sol'n:
Statement |Reason
1) In, quad. PQRS, |
m<S=m<P=m<Q=m<R=90 degrees |statement 1 & 3 of Given.
|
2) quad. PQRS is a rectangle. |Statement 1) and def'n of a rectangle.
|
3) seg PS is congreuent to seg QR |statement 2) and opposite sides of a
| rectangle are congruent.
|
4) In triangle SQR, |given statement 2) and statement 3)
seg SR = .8 and seg QR = .6 |
|
5) In triangle SQR, |
SQ^2 = SR^2 + SQ^2 |Pythagorus theorem.
<=> SQ = sqrt ( SR^2 + SQ^2 )
<=> SQ = sqrt ( .8^2 + .6^2 )
<=> SQ = sqrt ( .64 + .36 )
= sqrt ( 1.00 )
= 1
therefore SQ = 1
here, SQ = d
so sqr ( d ) = sqr ( SR ) + sqr ( RQ )
= sqr ( X ) + sqr ( Y ) ( not the lines, but the position of the point )
<=> d = sqrt ( sqr ( X ) + sqr ( Y )
It would be nice if someone explained how r=atan2(x,y) works.
Comment