Hey,
I am a flash programmer that has hit a snag and seeing as math’s has never been my strong point I need some help working this problem out
I have an object (say a ruler) and as I rotate it around the center of the ruler i want to move a box relative to the angle with out rotating the box too. So if the ruler angle was vertical (angle set to 0) then the box x and y cowardliness would be relative to that angle. i want is so no matter what angle the ruler is the box moves around with the ruler always staying with in a set distance to the ruler but never it self rotating
I can not work out how to get the angle and use it to move the box object around relatively with out also rotating it. I want to move the box around with the ruler but always have its actual rotation always at 0 as it moves around with the ruler
I want some thing like
box._x = Math.SomeThing(Take the rotation of the ruler and use its value to work out were the x position of the box needs to be so that it has rotated around with the ruler with out actually rotating it self i.e. so that as the box moves around with the ruler its rotation always remains at 0)
box._y = Math.SomeThing(Take the rotation of the ruler and use its value to work out were the y position of the box needs to be so that it has rotated around with the ruler with out actually rotating it self i.e. so that as the box moves around with the ruler its rotation always remains at 0)
I can use any of the following to help:
Math.abs()
Computes an absolute value.
Math.acos()
Computes an arc cosine.
Math.asin()
Computes an arc sine.
Math.atan()
Computes an arc tangent.
Math.atan2()
Computes an angle from the x-axis to the point.
Math.ceil()
Rounds a number up to the nearest integer.
Math.cos()
Computes a cosine.
Math.exp()
Computes an exponential value.
Math.floor()
Rounds a number down to the nearest integer.
Math.log()
Computes a natural logarithm.
Math.max()
Returns the larger of the two integers.
Math.min()
Returns the smaller of the two integers.
Math.pow()
Computes x raised to the power of the y.
Math.random()
Returns a pseudo-random number between 0.0 and 1.0.
Math.round()
Rounds to the nearest integer.
Math.sin()
Computes a sine.
Math.sqrt()
Computes a square root.
Math.tan()
Computes a tangent.
Property summary for the Math class
All the following properties for the Math class are constants:
Property Description
Math.E
Euler’s constant and the base of natural logarithms (approximately 2.718).
Math.LN2
The natural logarithm of 2 (approximately 0.693).
Math.LOG2E
The base 2 logarithm of e (approximately 1.442).
Math.LN2
The natural logarithm of 10 (approximately 2.302).
Math.LOG10E
The base 10 logarithm of e (approximately 0.434).
Math.PI
The ratio of the circumference of a circle to its diameter (approximately 3.14159).
Math.SQRT1_2
The reciprocal of the square root of 1/2 (approximately 0.707).
Math.SQRT2
The square root of 2 (approximately 1.414).
Any ideas on how I can do this using some formula?
Cheers
Rabid Lemming


LinkBack URL
About LinkBacks