Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Problem with hypotenese Length

  1. May 9, 2012 #1
    sideA = adjacent
    sideB = opposite
    sideC = hypotenese

    Find Angle

    angle = inverse tan = sideA / sideB

    Find side

    find the X component
    sideC = cos( angle ) * sideA

    find the Y Component
    sideC = sin( angle ) * sideB

    So my question is is how or why is my hypotenese line being displayed shorter than
     

    Attached Files:

  2. jcsd
  3. May 9, 2012 #2

    berkeman

    User Avatar

    Staff: Mentor

    Your definitions of the angle and the cos() and sin() are wrong.

    Try again?
     
  4. May 9, 2012 #3
    sideA = adjacent
    sideB = opposite
    sideC = hypotenese

    Find Angle

    angle = inverse tan = sideB / sideA

    Find side

    find the X component
    sideC = sideA / cos( angle )

    find the Y Component
    sideC = sideB / sin( angle )


    I think I got the formula wrote the wrong way but now my Image looks like this
     

    Attached Files:

  5. May 9, 2012 #4

    berkeman

    User Avatar

    Staff: Mentor

    Your equations look correct now. How are you generating the figure?
     
  6. May 9, 2012 #5
    Hi,
    I don't no what you mean by figure?
    but here is what I have done

    sideA = x2 - x1 which equals 200pixels
    sideB = y2 - y1 which equals -200pixels

    angle = inverse tan = sideB / sideA

    angle is -0.7853981633974483 in radians

    find the X component
    sideC = sideA / cos( angle )
    sideC equals 282.84271247461896

    find the Y Component
    sideC = sideB / sin( angle )
    sideC equals 282.842712474619
     
  7. May 9, 2012 #6

    berkeman

    User Avatar

    Staff: Mentor

    Why is sideB negative in length?

    (the figure I refer to is your drawing of the triange)
     
  8. May 9, 2012 #7
    hi,
    because in Java programming the x coordinates travel across the screen and the y coordinates travel down the screen so when I use the formula y2 - y1 then we are travelling
    up the screen which gives us negative 200
     

    Attached Files:

  9. May 9, 2012 #8
    There's a little function called Math.abs() ... *wink wink*
     
  10. May 9, 2012 #9
    Hi,
    I used Math.abs( y2 - y1 ) which gives me 200 instead of -200 but I still get the same
    results anyway
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Problem with hypotenese Length
  1. Length of a helix (Replies: 1)

  2. Triangle Lengths (Replies: 3)

  3. Correlation length (Replies: 2)

  4. Is this arc length? (Replies: 3)

Loading...