getPoint method

Vector? getPoint(
  1. double t, [
  2. Vector? optionalTarget
])
override

Implementation

getPoint(double t, [Vector? optionalTarget]) {
  optionalTarget ??= Vector3();
  final point = optionalTarget;

  t *= math.pi * 2;

  const r = 0.5;

  final x = ( 1 + r * math.cos( q * t ) ) * math.cos( p * t );
  final y = ( 1 + r * math.cos( q * t ) ) * math.sin( p * t );
  final z = r * math.sin( q * t );

  return (point as Vector3).setValues( x, y, z ).scale( radius );
}