getPoint method
Vector?
getPoint(
- double t, [
- 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 );
}