How to find points on the circumference of a arc knowing a start point, an end point and the radius?

后端 未结 2 1599
面向向阳花
面向向阳花 2021-01-01 04:22

Please see the image below for a visual clue to my problem:

\"Problem\"

I have the coordinates for poin

相关标签:
2条回答
  • 2021-01-01 04:43

    The equation of a circle with center (h,k) and radius r is

    (x - h)² + (y - k)² = r² if that helps

    check out this link for points http://www.analyzemath.com/Calculators/CircleInterCalc.html

    The parametric equation for a circle is

    x = cx + r * cos(a) y = cy + r * sin(a) Where r is the radius, cx,cy the origin, and a the angle from 0..2PI radians or 0..360 degrees.

    0 讨论(0)
  • 2021-01-01 05:05

    In the notation of my answer to your linked question (i.e. x,y is the current location, fx,fy is the current 'forward vector', and lx,ly is the current 'left vector')

    for (i=0; i<=10; i++)
    {
      sub_angle=(i/10)*deg2rad(22.5);
      xi=x+285.206*(sin(sub_angle)*fx + (1-cos(sub_angle))*(-lx))
      yi=y+285.206*(sin(sub_angle)*fy + (1-cos(sub_angle))*(-ly))
      // now plot green point at (xi, yi)
    }
    

    would generate eleven green points equally spaced along the arc.

    0 讨论(0)
提交回复
热议问题