81 d1 =
b *
b - a * a *
b + a * a / 4;
83 float rotX = (matXY[0] *
x + matXY[1] *
y);
84 float rotY = (matXY[2] *
x + matXY[3] *
y);
86 rotX = (matXY[0] *
x - matXY[1] *
y);
87 rotY = (matXY[2] *
x - matXY[3] *
y);
89 rotX = (-matXY[0] *
x - matXY[1] *
y);
90 rotY = (-matXY[2] *
x - matXY[3] *
y);
92 rotX = (-matXY[0] *
x + matXY[1] *
y);
93 rotY = (-matXY[2] *
x + matXY[3] *
y);
96 while (a * a * (
y - .5) >
b *
b * (
x + 1)) {
98 d1 +=
b *
b * (2 *
x + 3);
101 d1 +=
b *
b * (2 *
x + 3) + a * a * (-2 *
y + 2);
105 rotX = (matXY[0] *
x + matXY[1] *
y);
106 rotY = (matXY[2] *
x + matXY[3] *
y);
108 rotX = (matXY[0] *
x - matXY[1] *
y);
109 rotY = (matXY[2] *
x - matXY[3] *
y);
111 rotX = (-matXY[0] *
x - matXY[1] *
y);
112 rotY = (-matXY[2] *
x - matXY[3] *
y);
114 rotX = (-matXY[0] *
x + matXY[1] *
y);
115 rotY = (-matXY[2] *
x + matXY[3] *
y);
118 d2 =
b *
b * (
x + .5) * (
x + .5) + a * a * (
y - 1) * (
y - 1) - a * a *
b *
b;
121 d2 +=
b *
b * (2 *
x + 2) + a * a * (-2 *
y + 3);
125 d2 += a * a * (-2 *
y + 3);
128 rotX = (matXY[0] *
x + matXY[1] *
y);
129 rotY = (matXY[2] *
x + matXY[3] *
y);
131 rotX = (matXY[0] *
x - matXY[1] *
y);
132 rotY = (matXY[2] *
x - matXY[3] *
y);
134 rotX = (-matXY[0] *
x - matXY[1] *
y);
135 rotY = (-matXY[2] *
x - matXY[3] *
y);
137 rotX = (-matXY[0] *
x + matXY[1] *
y);
138 rotY = (-matXY[2] *
x + matXY[3] *
y);
191 if (!im.Contains(ya, xa) || !im.Contains(yb, xb)) {
192 int width = pim->Width();
193 int height = pim->Height();
194 const bool xdir = xa < xb, ydir = ya < yb;
195 float nx0 = xa, nx1 = xb, ny0 = ya, ny1 = yb, &xleft = xdir ? nx0 : nx1,
196 &yleft = xdir ? ny0 : ny1, &xright = xdir ? nx1 : nx0,
197 &yright = xdir ? ny1 : ny0, &xup = ydir ? nx0 : nx1,
198 &yup = ydir ? ny0 : ny1, &xdown = ydir ? nx1 : nx0,
199 &ydown = ydir ? ny1 : ny0;
201 if (xright < 0 || xleft >= width) {
205 yleft -= xleft * (yright - yleft) / (xright - xleft);
208 if (xright >= width) {
209 yright -= (xright - width) * (yright - yleft) / (xright - xleft);
212 if (ydown < 0 || yup >= height) {
216 xup -= yup * (xdown - xup) / (ydown - yup);
219 if (ydown >= height) {
220 xdown -= (ydown - height) * (xdown - xup) / (ydown - yup);
230 int xbas, xhaut, ybas, yhaut;
244 int x,
y, dx, dy, incrmX, incrmY, dp,
N, S;
void DrawEllipse(int xc, int yc, int radiusA, int radiusB, const Color &col, Image *pim, double angle=0.0)