“Kubikbeziere -Kurvenfunktion” Code-Antworten

Beziere -Kurvenfunktion

/**
     * @function getPoint
     * @param {number} t the time value between 0 and 1
     * @returns {Vector} the point at the time value
     * @memberof BezierCurve
     */
function getPoint(t: number): Vector {
  const x = (1 - t) * (1 - t) * this.p0.x + 2 * t * (1 - t) * this.p1.x + t * t * this.p2.x;
  const y = (1 - t) * (1 - t) * this.p0.y + 2 * t * (1 - t) * this.p1.y + t * t * this.p2.y;
  return new Vector(x, y);
}
Himanshu Jangid

Kubikbeziere -Kurvenfunktion

/**
     * @function getPoint
     * @param {number} t the time value between 0 and 1
     * @returns {Vector} the point at the time value
     * @memberof CubicBezierCurve
     */
function getPoint(t: number): Vector {
  const x = (1 - t) * (1 - t) * (1 - t) * this.p0.x + 3 * t * (1 - t) * (1 - t) * this.p1.x + 3 * t * t * (1 - t) * this.p2.x + t * t * t * this.p3.x;
  const y = (1 - t) * (1 - t) * (1 - t) * this.p0.y + 3 * t * (1 - t) * (1 - t) * this.p1.y + 3 * t * t * (1 - t) * this.p2.y + t * t * t * this.p3.y;
  return new Vector(x, y);
}
Himanshu Jangid

Ähnliche Antworten wie “Kubikbeziere -Kurvenfunktion”

Fragen ähnlich wie “Kubikbeziere -Kurvenfunktion”

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen