3 ms·
That doesn't make any sense. If you want to represent an ideal circle, calculus doesn't help, best you can do is pick an epsilon and add zillions of points to c
by gnulinux 6y ago
That doesn't make any sense. If you want to represent an ideal circle, calculus doesn't help, best you can do is pick an epsilon and add zillions of points to create an approximate circle. Even then most computational geometry algorithms won't work for that DS. If you're applying algebraic operations to that circle (let's say shear) you'll have to modify each and every single point (inefficient). What you want to do is to preserve a list of ideal (Platonic) shapes, apply transformations to them, and then convert this geometry to a list of vertices, edges and faces. Source: I've been a researcher on making parametric CAD tools that deal with problems like this for years.
- phkahler 6y agoArc length can be computed via integrals, but we dont really bother because breaking into segments is good enough (and elipses dont have a nice solution). For circular arcs, closed form solution exist even for the area. If you can accept the accuracy, the method of defining shapes from primitives is (to me) clearly simpler. It was of course just an example TFA used to highlight different approaches.
- phkahler 6y agoWe are on the same page. Dont use line segments, use NURBS curves. Length and area can be evaluated via piece wise approximation or numerical integration along the curve - which is a different flavor of the same thing.
- gnulinux 6y agoYeah I guess my point was at that point you'll have different APIs for square and circle.