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;
t *= 2 * math.pi;
const R = 10;
const s = 50;
final x = s * math.sin( t );
final y = math.cos( t ) * ( R + s * math.cos( t ) );
final z = math.sin( t ) * ( R + s * math.cos( t ) );
return point.setValues( x, y, z );
}