Triangles following a spiral path

$colors = [ 'F9F789', 'C0F479', '7BEF6B', '5DE98A', '4FE4C1', '42BEDF', '366ED9', '3B2AD4', '7F1ECF', 'C814C9', 'C40972', 'BF0015' ]; $points = []; $points_str = []; $center_point = [420, 380]; $angles = [90, 210, 330]; $radius = 10; $triangle_count = 54; $plastic_number = 1.3247; list($scale, $rotate, $translate_x, $translate_y) = [0.28, 0, 0, 0]; $triangles = []; foreach($angles as $angle) { $rad = deg2rad($angle); $points[] = [ $center_point[0] + $radius*cos($rad), $center_point[1] + $radius*sin($rad) ]; } foreach($points as $point) { $points_str[] = implode(',', $point); } $points_str = implode(' ', $points_str); for($i = 0; $i < $triangle_count; $i++) { $s = $i * $scale * $plastic_number; $rotate = ($rotate + 20) % 360; $translate_x = $translate_y = $s; $color = $colors[$i % 12]; $fo = 1 - (0.9/$triangle_count) * $i; $triangles[] = "<polygon points='{$points_str}' transform='scale({$s}) rotate({$rotate}) translate({$translate_x}, {$translate_y})' fill='#{$color}' stroke='#{$color}' fill-opacity='{$fo}' />"; } $triangles = implode('', $triangles); echo "<svg width='760' height='760' xmlns='http://www.w3.org/2000/svg'> <g stroke-width='0.1'>{$triangles}</g> </svg>";