Results 1 to 4 of 4

Math Help - Math formulas for computer screen measurement

  1. #1
    Newbie
    Joined
    Dec 2007
    Posts
    2

    Math formulas for computer screen measurement

    Hi
    I am trying to create 2 formulas based on computer screen pixel measurements to get the length of a line and its angle of rotation based on knowing the line's start and end position in a 2-dimensional field in space (a computer screen measured in pixels).

    My skills are rusty, and I am hoping that someone with geometry/trigonometry skills can suggest these formulas.
    The start point is labelled A, and its x and y coordinates are Ax and Ay.
    The end point is labelled B, and its x and y coordinates are Bx and By.
    If I know Ax, Ay and Bx and By, is it possible to develop formulas that will provide the angle of the line connecting A and B, and provide the length of that line?

    Given my limited understanding, it would be most helpful if suggesting formulas to define the elements/components.

    Given my limited skills, perhaps there is insufficient information from having only the start and end points as computer screen locations to be able to develop formulas to find the connecting line's angle and length.

    Any help would be appreciated.

    Kind Regards,
    saratogacoach
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Bar0n janvdl's Avatar
    Joined
    Apr 2007
    From
    Meh
    Posts
    1,630
    Thanks
    6
    Quote Originally Posted by saratogacoach View Post
    Hi
    I am trying to create 2 formulas based on computer screen pixel measurements to get the length of a line and its angle of rotation based on knowing the line's start and end position in a 2-dimensional field in space (a computer screen measured in pixels).

    My skills are rusty, and I am hoping that someone with geometry/trigonometry skills can suggest these formulas.
    The start point is labelled A, and its x and y coordinates are Ax and Ay.
    The end point is labelled B, and its x and y coordinates are Bx and By.
    If I know Ax, Ay and Bx and By, is it possible to develop formulas that will provide the angle of the line connecting A and B, and provide the length of that line?

    Given my limited understanding, it would be most helpful if suggesting formulas to define the elements/components.

    Given my limited skills, perhaps there is insufficient information from having only the start and end points as computer screen locations to be able to develop formulas to find the connecting line's angle and length.

    Any help would be appreciated.

    Kind Regards,
    saratogacoach
    With respect to the x-axis, the angle is given by:

    Angle = cot \left( \frac{ B_{y} - A_{y} }{ B_{x} - A_{x} } \right)


    EDIT: By subtracting that angle from 90 degrees, you'll get the angle with respect to the y-axis
    Follow Math Help Forum on Facebook and Google+

  3. #3
    MHF Contributor
    Joined
    Apr 2005
    Posts
    1,631
    If I know Ax, Ay and Bx and By, is it possible to develop formulas that will provide the angle of the line connecting A and B, and provide the length of that line?

    Yes to both.

    Angle of the line AB with the horizontal = arctan[(By -Ay) / (Bx -Ax)]

    Length of the line AB = sqrt[(By -Ay)^2 +(Bx -Ax)^2]
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    Dec 2007
    Posts
    2
    Thank you both for your helpful replies.

    Kind Regards,

    saratogacoach
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Computer Science Math for a senior in HS
    Posted in the Math Forum
    Replies: 0
    Last Post: February 29th 2012, 03:34 PM
  2. Design And Measurement math problem
    Posted in the Geometry Forum
    Replies: 1
    Last Post: April 18th 2010, 08:37 PM
  3. Replies: 0
    Last Post: March 29th 2007, 03:14 PM
  4. need a computer math whiz!!
    Posted in the Calculus Forum
    Replies: 2
    Last Post: July 8th 2006, 08:03 AM

Search Tags


/mathhelpforum @mathhelpforum