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 * t;

		final x = - 0.22 * math.cos( t ) - 1.28 * math.sin( t ) - 0.44 * math.cos( 3 * t ) - 0.78 * math.sin( 3 * t );
		final y = - 0.1 * math.cos( 2 * t ) - 0.27 * math.sin( 2 * t ) + 0.38 * math.cos( 4 * t ) + 0.46 * math.sin( 4 * t );
		final z = 0.7 * math.cos( 3 * t ) - 0.4 * math.sin( 3 * t );

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