MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / quadTo

Method quadTo

src/main/java/field/graphics/FLine.java:299–310  ·  view source on GitHub ↗

draws a curve from the current position, towards (but not through) `q1x, q1y`, then onto `x, y`.

(double q1x, double q1y, double x, double y)

Source from the content-addressed store, hash-verified

297 double c1x = (at.x + q1x * 2) / 3;
298 double c1y = (at.y + q1y * 2) / 3;
299 double c2x = (at.x * 2 + q1x) / 3;
300 double c2y = (at.y * 2 + q1y) / 3;
301
302 return cubicTo(c1x, c1y, c2x, c2y, x, y);
303 }
304
305 /**
306 * draws a curve from the current position, towards (but not through) the relative position `q1x, q1y`, then onto + `x, y`.
307 */
308 public FLine quadToRel(double q1x, double q1y, double x, double y) {
309 if (nodes.size() == 0) return moveTo(x, y);
310
311 Vec3 at = last().to;
312
313 return quadTo(at.x + q1x, at.y + q1y, at.x + x, at.y + y);

Callers 2

quadToRelMethod · 0.95
toFLineMethod · 0.80

Calls 4

moveToMethod · 0.95
lastMethod · 0.95
cubicToMethod · 0.95
sizeMethod · 0.45

Tested by

no test coverage detected