You are viewing a single comment's thread. Return to all comments →
I convert x to double-float type.
(defun ft (x) (coerce x 'double-float))
replace (/ y 2) ==> (* 0.5 y) //not sure "/" is a integer divison or not.
2.What is in your points list? (passed 1/3; assume this is correct.)
I create a newlist by copy the 1st point and append to the end.
sq_points = (p0,p1,p2,p3)
new_points = (p0,p1,p2,p3,p0); compute p0,p1; and pop p0
new_points = (p1,p2,p3,p0); compute p1,p2; and pop p1
new_points = (p2,p3,p0); compute p2,p3; and pop p2
new_points = (p3,p0); compute p3,p3
sum all above.
Seems like cookies are disabled on this browser, please enable them to open this website
Compute the Area of a Polygon
You are viewing a single comment's thread. Return to all comments →
I convert x to double-float type.
(defun ft (x) (coerce x 'double-float))
replace (/ y 2) ==> (* 0.5 y) //not sure "/" is a integer divison or not.
2.What is in your points list? (passed 1/3; assume this is correct.)
I create a newlist by copy the 1st point and append to the end.
sq_points = (p0,p1,p2,p3)
new_points = (p0,p1,p2,p3,p0); compute p0,p1; and pop p0
new_points = (p1,p2,p3,p0); compute p1,p2; and pop p1
new_points = (p2,p3,p0); compute p2,p3; and pop p2
new_points = (p3,p0); compute p3,p3
sum all above.