Cheers,
Ralf.
On 9/19/06, Michael Schmalle
<[EMAIL PROTECTED]> wrote:
Hi,
I'm doing some serious trig with rotation and sizing. I have a problem I have been trying to figure out, this question is aimed more at Adobe engineers. ;-)
Say I take the rotation angle of a component, I have rounded this the nearest whole number before any trig calcs.
1. get rotation ie 30
2. get mouse x, y which in the beginning is like 40,45
3. calc a dsitance from mouse to client -> mx, mx -> cx, cy this number is not rounded using Point.distance()
4. use atan2() to get mouse client angle, now we are in crazy decimals
5. calc theta, crazy decimals
6. calc radians, crazy decimals
7. calc sine of distance from mouse to client ,crazy decimals
8. calc another y change using cosine, more crazy decimals
9. calc a slopedistance, even more decimals
10. Then subtract slopdistance from current client width, which in the begining was a whole number, now it is DECIMAL!
Now, I have a new calculated x and y with width and height that are all in decimals. THis is giving me movement fragments that I cannot get rid of.
The question is where and when should I floor(), round() or ciel()? I see you used Number(newX.toFixed(1)) in your rotation calcs but this dosn't do anything for me here.
I keep getting numbers like 23.0000000000034 .
Help! :)
Peace, Mike
--
What goes up, does come down.
--
Ralf Bokelberg <[EMAIL PROTECTED]>
Flex & Flash Consultant based in Cologne/Germany __._,_.___
SPONSORED LINKS
| Software development tool | Application development software | Development software |
| Development outsourcing software | Embedded software development |
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
__,_._,___
