getPoint method

  1. @override
Vector? getPoint(
  1. double t, [
  2. Vector? optionalTarget
])
override

Implementation

@override
	Vector? getPoint(double t, [Vector? optionalTarget]) {
  optionalTarget ??= Vector3();
  late Vector3 optTarget;

  if(optionalTarget is Vector2){
    optTarget = Vector3(optionalTarget.x,optionalTarget.y,0);
  }
  else if(optionalTarget is Vector4){
    optTarget = Vector3(optionalTarget.x,optionalTarget.y,optionalTarget.z);
  }
  else{
    optTarget = optionalTarget as Vector3;
  }

		final point = optTarget;

		t *= 2 * math.pi;

		final x = 16 * math.pow( math.sin( t ), 3 ).toDouble();
		final y = 13 * math.cos( t ) - 5 * math.cos( 2 * t ) - 2 * math.cos( 3 * t ) - math.cos( 4 * t );
		const z = 0.0;

		return point.setValues( x, y, z ).scale( scale );
	}