1 /** 2 2D elipse type. 3 4 Copyright: Chris Jones 5 License: Boost Software License, Version 1.0 6 Authors: Chris Jones 7 */ 8 9 module dg2d.elipse; 10 11 import dg2d.scalar; 12 import dg2d.point; 13 import dg2d.misc; 14 import dg2d.path; 15 16 import std.algorithm: among; 17 18 /** 19 2D Elipse 20 x0,y0 is the center of the elipse 21 x1,y1 is the radius at 0 degrees 22 x2,y2 is the radius at 90 degrees 23 24 if you have a circle of radius 1 at the origin, then imagine it transformed so that.. 25 (0,0)-->(x0,y0) 26 (1,0)-->(x1,y1) 27 (0,1)-->(x2,y2) 28 */ 29 30 /* 31 maybe need seperate simple elipse, origin,width,height, and freeform elipse as above, ?? 32 */ 33 34 struct Elipse 35 { 36 Scalar x0 = 0; 37 Scalar y0 = 0; 38 Scalar x1 = 0; 39 Scalar y1 = 0; 40 Scalar x2 = 0; 41 Scalar y2 = 0; 42 43 this(Scalar x0, Scalar y0, Scalar x1, Scalar y1, Scalar x2, Scalar y2) 44 { 45 this.x0 = x0; 46 this.y0 = y0; 47 this.x1 = x1; 48 this.y1 = y1; 49 this.x2 = x2; 50 this.y2 = y2; 51 } 52 }