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;

	const a = 30; // radius
	const b = 150; // height

	final t2 = 2 * math.pi * t * b / 30;

	final x = math.cos( t2 ) * a;
	final y = math.sin( t2 ) * a;
	final z = b * t;

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