Shop OBEX P1 Docs P2 Docs Learn Events
Trying to find a mathematical relationship... — Parallax Forums

Trying to find a mathematical relationship...

Beau SchwabeBeau Schwabe Posts: 6,568
edited 2009-12-21 17:51 in General Discussion
For a Propeller application, as 'A' goes from 0 to 90, I'm looking for the segment length of 'B' (See CORD attachment)... it would be easy if the segment length was not parallel to the horizon. The 'plot' looks like an air plane wing (See Graph attachment), but I don't think that is exactly what I'm looking for.

The table here shows the relationship...
Deg     Segment Length

0       0
7.5     7.5
15      13.5
22.5    19.5
30      24
37.5    30
45      33
52.5    36
60      37.5
67.5    37.5
75      34.5
82.5    28.5
90      0




...and if you graph the two columns out you can see the 'air plane' wing. I'd rather not use a lookup table ... If anyone knows a formula I'd appreciate it.

Thanks

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe

IC Layout Engineer
Parallax, Inc.
781 x 767 - 112K
632 x 424 - 42K

Comments

  • mparkmpark Posts: 1,305
    edited 2009-12-20 15:43
    Sqrt(90*90-a*a) - 90 + a
  • TylerSTylerS Posts: 7
    edited 2009-12-20 16:48
    Eqn of circle
    x^2 + y^2 = r^2

    Eqn of Line
    y = x + r

    You know y (a), so we need to solve these equations for x

    Circle x = sqrt( r^2 - y^2) (answer is positive or negative number)
    Line x = y - r

    Then you want the difference between the two numbers, the line is always less negative, so to get a positive answer

    LineX - CircleX = B

    y-r - (-sqrt(r^2 - y^2)) = B
    or
    y-r + sqrt (r^2 - y^2) = B

    Or plugging in

    A-90 + sqrt(90^2 - A^2) = B
    Or, the same thing as mpark.
  • kwinnkwinn Posts: 8,697
    edited 2009-12-20 17:50
    If I interpret your question correctly you are looking for the length of the horizontal line (B) between the chord and the circumference of the circle.

    The Cartesian coordinates of a circle can be calculated from the formula X^2 + Y^2 = R^2 where R is the radius of the circle.

    X on the circle (Xr) would be SQRT(R^2 – Y^2)

    X on the chord (Xc) would be R – Y

    B = Xr – Xc or (SQRT(R^2 – Y^2)) – (R –Y)

    Y could be fixed steps between 0 and R or the sin of the angle between 0 and 90 degrees as required.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-12-20 20:03
    mpark,

    Wow, I think you nailed it right off the bat (See Series #3 in the attached image)... for some reason I just didn't see it. Thank you!

    This is for a new (updated) accelerometer Demo using tilt as well as rotational deg, and I needed to know this length (or close approximation) mostly for the visual. I will post code soon to the OBEX.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
    632 x 416 - 43K
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-12-21 00:56
    Here is a video link the new Graphical demo for the Memsic2125 accelerometer ...

    Video Demonstration

    Source code available from the OBEX ... obex.parallax.com/objects/140/



    In the video, the xTilt affects the horizontal level (blue)
    The yTilt affects the horizontal up and down (white)
    The Theta affects the inner 'ticks' (yellow) which is the rotational deg relationship between X and Y

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 12/22/2009 3:27:42 AM GMT
    616 x 488 - 40K
  • mparkmpark Posts: 1,305
    edited 2009-12-21 17:51
    Cool video!
Sign In or Register to comment.