Update PGraphics.java

At row 3214 changed  

public float bezierPoint(float a, float b, float c, float d, float t) {
  float t1 = 1.0f - t;
  return a*t1*t1*t1 + 3*b*t*t1*t1 + 3*c*t*t*t1 + d*t*t*t;
}

to  

float bezierPoint (float a, float b, float c, float d, float t) {
  float t1 = t-1.0f;
  return t * ( 3*t1*(b*t1-c*t) + d*t*t ) - a*t1*t1*t1;
}
, works the same but faster
This commit is contained in:
Prince-Polka
2017-09-08 19:12:59 +02:00
committed by GitHub
parent 8bf2ec1c6f
commit 2746369547
+3 -5
View File
@@ -3211,12 +3211,10 @@ public class PGraphics extends PImage implements PConstants {
* @see PGraphics#bezierVertex(float, float, float, float, float, float)
* @see PGraphics#curvePoint(float, float, float, float, float)
*/
public float bezierPoint(float a, float b, float c, float d, float t) {
float t1 = 1.0f - t;
return a*t1*t1*t1 + 3*b*t*t1*t1 + 3*c*t*t*t1 + d*t*t*t;
float bezierPoint (float a, float b, float c, float d, float t) {
float t1 = t-1.0f;
return t * ( 3*t1*(b*t1-c*t) + d*t*t ) - a*t1*t1*t1;
}
/**
* ( begin auto-generated from bezierTangent.xml )
*