Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2014-06-04 14:07:37

LolTrains
Member
Registered: 2014-06-04
Posts: 1

Getting a line intersect points A and B.

Hi, and thanks for helping!

Education level: In highschool.

I enjoy programming, and thats what I am doing right now, so things may be a bit different in my question.

The problem:
Note: This is all in X and Y axis.
I have point A(100,100), and point B(200,200). Using the distance formula, the distance between them is 141.42135623731. The midpoint for X and Y is both 150.
This is where its different because I program; I am making a user interface, and have a line. The lines length is the distance (aprox 141). I need a formula that will rotate the line in such a way that it will intersect both A and B (A and B will move, and not always be at 100,100 and 200,200). For the user interface the center of the line is the midpoint, so it just needs to be rotated at the right angle.

I cant make a formula for the problem above, so Im hoping that someone will help me! Thanks! big_smile

--Michael

Offline

#2 2014-06-04 14:55:27

LolTrains
Member
Registered: 2014-06-04
Posts: 1

Re: Getting a line intersect points A and B.

No need for an answer, I have the formula. Thanks.

Offline

#3 2014-06-04 19:44:01

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Getting a line intersect points A and B.

Hi LolTrains;

Welcome to the forum then.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#4 2014-06-04 20:10:52

Agnishom
Real Member
From: Riemann Sphere
Registered: 2011-01-29
Posts: 24,974
Website

Re: Getting a line intersect points A and B.

Hi;

Welcome to the forum!

What formula did you get?

What is your favorite color?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.

Offline

Board footer

Powered by FluxBB