Page 1 of 1
Divide arc by measurin leight and radius
Posted: Thu Mar 11, 2010 4:57 pm
by WroooDude
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
Posted: Fri Mar 12, 2010 11:00 am
by nuntius
Here's a skeleton:
Code: Select all
(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
Posted: Sun Mar 14, 2010 1:03 pm
by WroooDude
could you be more precisely? please...
Re: Divide arc by measurin leight and radius
Posted: Sun Mar 14, 2010 8:22 pm
by nuntius
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
Posted: Mon Mar 15, 2010 12:12 pm
by WroooDude
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
Posted: Mon Mar 15, 2010 2:33 pm
by nuntius
For rounding, you probably want
CEILING.
As to dividing the arc, how is it currently represented?
Re: Divide arc by measurin leight and radius
Posted: Tue Mar 16, 2010 11:50 am
by WroooDude
i made it!!!
thanks....
regards