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

Method evaluateCubicFrame

src/main/java/field/graphics/FLine.java:77–91  ·  view source on GitHub ↗
(double ax, double ay, double c1x, double c1y, double c2x, double c2y, double bx, double by, double alpha, Vec2 out)

Source from the content-addressed store, hash-verified

75 public FLine(Map<Object, Object> attributes) {
76 for (Map.Entry e : attributes.entrySet()) {
77 String name = (String) Conversions.convert(e.getKey(), String.class);
78 asMap_set(name, e.getValue());
79 }
80 }
81
82 @HiddenInAutocomplete
83 static public Vec2 evaluateCubicFrame(double ax, double ay, double c1x, double c1y, double c2x, double c2y, double bx, double by, double alpha, Vec2 out) {
84 if (out == null) out = new Vec2();
85
86 double oma = 1 - alpha;
87 double oma2 = oma * oma;
88 double oma3 = oma2 * oma;
89 double alpha2 = alpha * alpha;
90 double alpha3 = alpha2 * alpha;
91
92 out.x = ax * oma3 + 3 * c1x * alpha * oma2 + 3 * c2x * alpha2 * oma + bx * alpha3;
93 out.y = ay * oma3 + 3 * c1y * alpha * oma2 + 3 * c2y * alpha2 * oma + by * alpha3;
94

Callers 4

renderCubicToMethod · 0.95
nextDoubleMethod · 0.45
nextGaussianMethod · 0.45
segmentMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected