This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Math math mat! :D

I got two XY points, what Im trying todo is set the first XY1 to "move towards" XY2, in my application. I assign new XY positions for XY1 every 100ms or so. So to the math:

What I remember from school is that I need to use some sort of variation of the phytagoras theorem?

The new X and Y are C1 and C2 of the right angled triangle, and the hypotenuse is the direction in wich XY2 is relation to XY1.

So I know the length of the hypotenuse and calculate the angle between XY1 and XY2, can I calculate the C1 and C2 from that?

Hope I made sense, math is hellova fun, it's just to hard to manage for some of us.. :P

I got two XY points, what Im trying todo is set the first XY1 to "move towards" XY2, in my application. I assign new XY positions for XY1 every 100ms or so. So to the math:

What I remember from school is that I need to use some sort of variation of the phytagoras theorem?

The new X and Y are C1 and C2 of the right angled triangle, and the hypotenuse is the direction in wich XY2 is relation to XY1.

So I know the length of the hypotenuse and calculate the angle between XY1 and XY2, can I calculate the C1 and C2 from that?

Hope I made sense, math is hellova fun, it's just to hard to manage for some of us.. :P

Experts Exchange Solution brought to you by

Enjoy your complimentary solution view.

Get every solution instantly with Premium.
Start your 7-day free trial.

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

a point that is 100m from X1,Y1 in the direction of X2,Y2 is

X=X1+100m*(X2-X1)/sqrt((X2

Y=Y1+100m*(Y2-Y1)/sqrt((X2

The equation of a line between two points p1(x1,y1) and p2(x2,y2) is :

y = y1 + [(y2 - y1) / (x2 - x1)] * (x - x1)

(when x1 is not equal to x2)

To let a point move from p1 to p2, you just let x vary from x1 to x2, and calculate the corresponding y with the above equation.

In the special case where x1 is equal to x2, the equation becomes :

x = x1

And to let a point move from p1 to p2, you just let y vary from y1 to y2, and calculate the corresponding x with the above equation.

C1=10*(Y2-Y1)/sqrt((X2-X1)

C2=10*(X2-X1)/sqrt((X2-X1)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trialI tried your solution first ozo and it works absolutely perfect. Much abliged!

Should I rename the Question to a more fitting title, as to help anyone else with similiar problems?

I initially thought it was a prerequisite to solve the math, thw angle that is.

But what little I actually understand from the given solution, you only need distance between the points to solve it?

C2=10*(X2-X1)/sqrt((X2-X1)

Is that: H = sqrt(c1^2 + c2^2)

Can you use the same formulae to calculate any side of the right angled triange if you know two of them, not only the hypotenuse (as the unknow) ?

Math / Science

From novice to tech pro — start learning today.

Experts Exchange Solution brought to you by

Enjoy your complimentary solution view.

Get every solution instantly with Premium.
Start your 7-day free trial.

myproblem.gif