0

2 点と符号付きバルジ係数 (弧が最初の点から 2 番目の点に時計回りまたは反時計回りで接続されているかどうか) を指定して、弧の中心点を計算します。

(define (solver x1 y1 x2 y2 bulge)
  (let* ((arc-angle (* 4 (atan bulge)))
         (chord-length (/ (sqrt (+ (expt (abs (- x1 x2)) 2) (expt (abs (- y1 y2)) 2))) 2))
         (radius (/ chord-length (cos (/ (- pi arc-angle) 2)))))
    (list arc-angle chord-length radius)))

> (solver 3 10 10 5 0.592)
'(2.1380655244738884 4.301162633521313 4.905882850266661)

with the equations (x-3)^2 + (y-10)^2 = 4.05^2
                   (x-10)^2 + (y-5)^2 = 4.05^2
solve to find x, y.
4

1 に答える 1