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 = t * 4 * math.pi; // normalized to 0..1
	final a = scale / 2;

	final x = a * ( 1 + math.cos( t ) );
	final y = a * math.sin( t );
	final z = 2 * a * math.sin( t / 2 );

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