This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

Divide arc by measurin leight and radius

7 posts · 2530 views

I need lisp that can divide any arc on segments by formula : X= L / 2*sqrt((R^2-(R-0.2)^2);
X - number of segments (first integer bigger than result of formula)
L - arc leight
R - radius of arc

Re: Divide arc by measurin leight and radius

Here's a skeleton:
(defun arc-segments (L R)
  "Returns X= L / 2*sqrt((R^2-(R-0.2)^2)"
  (/ L
     (* 2 (sqrt .... ) ) )

Re: Divide arc by measurin leight and radius

could you be more precisely? please...

Re: Divide arc by measurin leight and radius

To calculate R^2, use (expt R 2). Beyond that, I could write the whole formula, but feel that you might gain more by filling in the blanks.

Re: Divide arc by measurin leight and radius

OK, I get X from arc that I selected, but how to round result (x=7.2545) to first bigger integer?
and than how to make code to divide that selected arc to X segments?
THANKS....

Re: Divide arc by measurin leight and radius

For rounding, you probably want CEILING.

As to dividing the arc, how is it currently represented?

Re: Divide arc by measurin leight and radius

i made it!!!
thanks....
regards