getPoint method
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 p = 3;
const q = 4;
t *= math.pi * 2;
final x = ( 2 + math.cos( q * t ) ) * math.cos( p * t );
final y = ( 2 + math.cos( q * t ) ) * math.sin( p * t );
final z = math.sin( q * t );
return point.setValues( x, y, z ).scale(scale );
}