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 *= math.pi * 2;
final x = math.cos( 2 * t ) * ( 1 + 0.6 * ( math.cos( 5 * t ) + 0.75 * math.cos( 10 * t ) ) );
final y = math.sin( 2 * t ) * ( 1 + 0.6 * ( math.cos( 5 * t ) + 0.75 * math.cos( 10 * t ) ) );
final z = 0.35 * math.sin( 5 * t );
return point.setValues( x, y, z ).scale( scale );
}