Gangnam style в D

На этот раз мы реально вас удивим…

Как думаете, что можно сделать такого необычного с параметрическим представлением функции?

Оказывается, можно получить довольно интересные результаты, вот например, программа, с которой один из авторов блога, мучился больше 2-х недель. Читайте далее и поймёте почему.

Итак, код с комментариями:

import dgui.all;
import std.math;

// отрисовка отдельных точек
void drawPoint(Canvas c, int x, int y) {
  Pen p = new Pen(SystemColors.darkGreen, 1, PenStyle.solid);
  c.drawLine(p, x, y, x + 1, y + 1);
};


// функция Хэвисайда
float theta(float x)
{
  if (x < 0) return 0.0f;
  else
  {
    if (x == 0) return 0.5f;
    else return 1.0;
  }
}


// параметрический вид кривой Псая
float parametricX(float t)
{
  auto res = ((- (25.0 / 37.0) * sin((58.0 / 37.0) - 4.0 * t) + (809.0 / 54.0) * sin(t + (11.0 / 7.0)) + (9.0 / 19.0) * sin(2.0 * t + (108.0 / 23.0)) + (17.0 / 23.0) * sin(3.0 * t + (49.0 / 31.0)) + (11.0 / 12.0) * sin(5.0 * t + (107.0 / 68.0)) - (17.0 / 27.0)) * theta(71.0 * PI - t) * theta(t - 67.0 * PI) + ( - (6.0 / 49.0) * sin((39.0 / 25.0) - 8.0 * t) - (3.0 / 32.0) * sin((39.0 / 25.0) - 7.0 * t) - (2.0 / 11.0) * sin((64.0 / 41.0) - 6.0 * t) - (107.0 / 68.0) * sin((36.0 / 23.0) - 2.0 * t) - (228.0 / 31.0) * sin((69.0 / 44.0) - t) + (17.0 / 36.0) * sin(3.0 * t + (11.0 / 7.0)) + (11.0 / 49.0) * sin(4.0 * t + (113.0 / 24.0)) + (1.0 / 63.0) * sin(5.0 * t + (29.0 / 19.0)) + (1091.0 / 31.0)) * theta(67.0 * PI - t) * theta(t - 63.0 * PI) + ((35.0 / 8.0) * sin(t + (11.0 / 7.0)) + (15.0 / 23.0) * sin(2.0 * t + (52.0 / 33.0)) + (11.0 / 30.0) * sin(3.0 * t + (11.0 / 7.0)) + (1.0 / 18.0) * sin(4.0 * t + (63.0 / 40.0)) - (556.0 / 17.0)) * theta(63.0 * PI - t) * theta(t - 59.0 * PI) + (-(104.0 / 31.0) * sin((27.0 / 41.0) - 2.0 * t) + (523.0 / 45.0) * sin(t + (29.0 / 25.0)) + (40.0 / 37.0) * sin(3.0 * t + (25.0 / 41.0)) + (21.0 / 17.0) * sin(4.0 * t + (121.0 / 26.0)) + (148.0 / 27.0)) * theta(59.0 * PI - t) * theta(t - 55.0 * PI) + (-(9.0 / 20.0) * sin((13.0 / 11.0) - 18.0 * t) - (9.0 / 26.0) * sin((88.0 / 63.0) - 17.0 * t) - (15.0 / 41.0) * sin((81.0 / 161.0) - 15.0 * t) - (7.0 / 15.0) * sin((25.0 / 18.0) - 14.0 * t) - (59.0 / 89.0) * sin((13.0 / 34.0) - 12.0 * t) - (87.0 / 38.0) * sin((9.0 / 10.0) - 6.0 * t) - (117.0 / 22.0) * sin((23.0 / 42.0) - 5.0 * t) + (582.0 / 13.0) * sin(t + (64.0 / 37.0)) + (88.0 / 25.0) * sin(2.0 * t + (229.0 / 49.0)) + (1458.0 / 47.0) * sin(3.0 * t + (48.0 / 23.0)) + (167.0 / 50.0) * sin(4.0 * t + (151.0 / 50.0)) + (135.0 / 22.0) * sin(7.0 * t + (93.0 / 32.0)) + (143.0 / 102.0) * sin(8.0 * t + (100.0 / 33.0)) + (2.0 / 21.0) * sin(9.0 * t + (169.0 / 47.0)) + (41.0 / 124.0) * sin(10.0 * t + (84.0 / 19.0)) + (7.0 / 39.0) * sin(11.0 * t + (147.0 / 73.0)) + (15.0 / 17.0) * sin(13.0 * t + (69.0 / 17.0)) + (6.0 / 29.0) * sin(16.0 * t + (2.0 / 25.0)) + (7.0 / 43.0) * sin(19.0 * t + (57.0 / 16.0)) + (5.0 / 36.0) * sin(20.0 * t + (20.0 / 53.0)) + (225.0 / 41.0)) * theta(55.0 * PI - t) * theta(t - 51.0 * PI) + ( - (22.0 / 27.0) * sin((21.0 / 19.0) - 33.0 * t) - (23.0 / 28.0) * sin((56.0 / 75.0) - 32.0 * t) - (9.0 / 14.0) * sin((18.0 / 29.0) - 31.0 * t) - (32.0 / 33.0) * sin((145.0 / 109.0) - 29.0 * t) - (11.0 / 23.0) * sin((27.0 / 38.0) - 28.0 * t) - (91.0 / 114.0) * sin((26.0 / 31.0) - 26.0 * t) - (47.0 / 40.0) * sin((73.0 / 55.0) - 24.0 * t) - (54.0 / 53.0) * sin((8.0 / 21.0) - 21.0 * t) - (38.0 / 25.0) * sin((65.0 / 43.0) - 19.0 * t) - (108.0 / 65.0) * sin((11.0 / 17.0) - 14.0 * t) - (11.0 / 27.0) * sin((289.0 / 193.0) - 9.0 * t) + (3415.0 / 31.0) * sin(t + (65.0 / 34.0)) + (916.0 / 35.0) * sin(2.0 * t + (168.0 / 41.0)) + (85.0 / 16.0) * sin(3.0 * t + (37.0 / 41.0)) + (92.0 / 35.0) * sin(4.0 * t + (107.0 / 32.0)) + (107.0 / 27.0) * sin(5.0 * t + (14.0 / 31.0)) + (47.0 / 25.0) * sin(6.0 * t + (7.0 / 11.0)) + (35.0 / 12.0) * sin(7.0 * t + (49.0 / 26.0)) + (26.0 / 23.0) * sin(8.0 * t + (82.0 / 21.0)) + (48.0 / 25.0) * sin(10.0 * t + (26.0 / 103.0)) + (35.0 / 38.0) * sin(11.0 * t + (23.0 / 32.0)) + (15.0 / 22.0) * sin(12.0 * t + (160.0 / 41.0)) + (285.0 / 286.0) * sin(13.0 * t + (3.0 / 38.0)) + (8.0 / 19.0) * sin(15.0 * t + (336.0 / 79.0)) + (48.0 / 31.0) * sin(16.0 * t + (10.0 / 3.0)) + (122.0 / 87.0) * sin(17.0 * t + (37.0 / 23.0)) + (68.0 / 31.0) * sin(18.0 * t + (1.0 / 27.0)) + (11.0 / 9.0) * sin(20.0 * t + (58.0 / 21.0)) + (49.0 / 44.0) * sin(22.0 * t + 4.0) + (22.0 / 29.0) * sin(23.0 * t + (68.0 / 53.0)) + (1.0 / 2.0) * sin(25.0 * t + (86.0 / 23.0)) + (17.0 / 37.0) * sin(27.0 * t + (148.0 / 33.0)) + (21.0 / 29.0) * sin(30.0 * t + (137.0 / 30.0)) + (12.0 / 29.0) * sin(34.0 * t + (202.0 / 47.0)) + (15.0 / 34.0) * sin(35.0 * t + (10.0 / 29.0)) + (861.0 / 37.0)) * theta(51.0 * PI - t) * theta(t - 47.0 * PI) + (-(5.0 / 13.0) * sin((9.0 / 14.0) - 8.0 * t) - (33.0 / 25.0) * sin((105.0 / 106.0) - 6.0 * t) - (12.0 / 61.0) * sin((47.0 / 46.0) - 5.0 * t) - (17.0 / 35.0) * sin((6.0 / 11.0) - 4.0 * t) - (617.0 / 35.0) * sin((58.0 / 41.0) - 2.0 * t) + (97.0 / 24.0) * sin(t + (49.0 / 11.0)) + (93.0 / 43.0) * sin(3.0 * t + (53.0 / 24.0)) + (52.0 / 69.0) * sin(7.0 * t + (19.0 / 8.0)) + (16.0 / 31.0)) * theta(47.0 * PI - t) * theta(t - 43.0 * PI) + ( - (10.0 / 31.0) * sin((55.0 / 39.0) - 6.0 * t) + (708.0 / 23.0) * sin(t + (53.0 / 28.0)) + (10.0 / 17.0) * sin(2.0 * t + (303.0 / 70.0)) + (201.0 / 200.0) * sin(3.0 * t + (275.0 / 92.0)) + (8.0 / 15.0) * sin(4.0 * t + (129.0 / 29.0)) + (2.0 / 23.0) * sin(5.0 * t + (110.0 / 41.0)) + (18.0 / 89.0) * sin(7.0 * t + (73.0 / 30.0)) + (949.0 / 15.0)) * theta(43.0 * PI - t) * theta(t - 39.0 * PI) + (-(22.0 / 41.0) * sin((42.0 / 41.0) - 5.0 * t) - (9.0 / 19.0) * sin((11.0 / 31.0) - 3.0 * t) + (1168.0 / 41.0) * sin(t + (59.0 / 37.0)) + (13.0 / 21.0) * sin(2.0 * t + (382.0 / 83.0)) + (15.0 / 29.0) * sin(4.0 * t + (105.0 / 29.0)) + (7.0 / 17.0) * sin(6.0 * t + (67.0 / 19.0)) - (2875.0 / 47.0)) * theta(39.0 * PI - t) * theta(t - 35.0 * PI) + (-(15.0 / 19.0) * sin((1.0 / 26.0) - 14.0 * t) - (111.0 / 31.0) * sin((7.0 / 31.0) - 4.0 * t) + (3698.0 / 39.0) * sin(t + (31.0 / 20.0)) + (135.0 / 22.0) * sin(2.0 * t + (1.0 / 35.0)) + (136.0 / 11.0) * sin(3.0 * t + (71.0 / 46.0)) + (57.0 / 13.0) * sin(5.0 * t + (29.0 / 19.0)) + (22.0 / 25.0) * sin(6.0 * t + (80.0 / 31.0)) + (29.0 / 40.0) * sin(7.0 * t + (212.0 / 47.0)) + (31.0 / 26.0) * sin(8.0 * t + (1.0 / 31.0)) + (55.0 / 27.0) * sin(9.0 * t + (51.0 / 29.0)) + (46.0 / 31.0) * sin(10.0 * t + (3.0 / 23.0)) + (27.0 / 29.0) * sin(11.0 * t + (48.0 / 47.0)) + (5.0 / 21.0) * sin(12.0 * t + (49.0 / 24.0)) + (23.0 / 40.0) * sin(13.0 * t + (11.0 / 9.0)) + (13.0 / 59.0) * sin(15.0 * t + (26.0 / 37.0)) - (15.0 / 16.0)) * theta(35.0 * PI - t) * theta(t - 31.0 * PI) + ((53.0 / 32.0) * sin(t + (54.0 / 37.0)) + (267.0 / 26.0) * sin(2.0 * t + (239.0 / 92.0)) + (35.0 / 33.0) * sin(3.0 * t + (13.0 / 34.0)) + (8.0 / 9.0) * sin(4.0 * t + (19.0 / 25.0)) + (7.0 / 15.0) * sin(5.0 * t + (17.0 / 16.0)) + (3.0 / 5.0) * sin(6.0 * t + (57.0 / 22.0)) + (15.0 / 52.0) * sin(7.0 * t + (27.0 / 22.0)) + (15.0 / 49.0) * sin(8.0 * t + (28.0 / 23.0)) + (2.0 / 17.0) * sin(9.0 * t + (180.0 / 77.0)) + (3.0 / 38.0) * sin(10.0 * t + (64.0 / 35.0)) + (5.0 / 34.0) * sin(11.0 * t + (35.0 / 24.0)) + (3.0 / 31.0) * sin(12.0 * t + (21.0 / 22.0)) - (5662.0 / 43.0)) * theta(31.0 * PI - t) * theta(t - 27.0 * PI) + ( - (6.0 / 25.0) * sin((12.0 / 47.0) - 9.0 * t) + (77.0 / 36.0) * sin(t + (159.0 / 35.0)) + (114.0 / 11.0) * sin(2.0 * t + (37.0 / 8.0)) + (13.0 / 19.0) * sin(3.0 * t + (77.0 / 41.0)) + (11.0 / 27.0) * sin(4.0 * t + (128.0 / 71.0)) + (6.0 / 11.0) * sin(5.0 * t + (191.0 / 52.0)) + (96.0 / 193.0) * sin(6.0 * t + (19.0 / 11.0)) + (3.0 / 17.0) * sin(7.0 * t + (7.0 / 4.0)) + (3.0 / 17.0) * sin(8.0 * t + (6.0 / 7.0)) + (3.0 / 20.0) * sin(10.0 * t + (31.0 / 43.0)) + (4078.0 / 31.0)) * theta(27.0 * PI - t) * theta(t - 23.0 * PI) + ( - (21.0 / 64.0) * sin((2.0 / 21.0) - 7.0 * t) - (35.0 / 58.0) * sin((29.0 / 33.0) - 6.0 * t) - (5.0 / 26.0) * sin((13.0 / 19.0) - 5.0 * t) + (3153.0 / 26.0) * sin(t + (29.0 / 19.0)) + (35.0 / 27.0) * sin(2.0 * t + (67.0 / 23.0)) + (19.0 / 9.0) * sin(3.0 * t + (32.0 / 7.0)) + (3.0 / 14.0) * sin(4.0 * t + (19.0 / 18.0)) - (12.0 / 7.0)) * theta(23.0 * PI - t) * theta(t - 19.0 * PI) + ( - (19.0 / 30.0) * sin((19.0 / 24.0) - 16.0 * t) - (10.0 / 23.0) * sin((41.0 / 27.0) - 15.0 * t) - (66.0 / 67.0) * sin((17.0 / 21.0) - 14.0 * t) - (43.0 / 42.0) * sin((1.0 / 64.0) - 13.0 * t) - (41.0 / 19.0) * sin((16.0 / 33.0) - 8.0 * t) + (28281.0 / 404.0) * sin(t + (114.0 / 31.0)) + (756.0 / 43.0) * sin(2.0 * t + (904.0 / 201.0)) + (817.0 / 41.0) * sin(3.0 * t + (25.0 / 32.0)) + (371.0 / 43.0) * sin(4.0 * t + (208.0 / 45.0)) + (80.0 / 21.0) * sin(5.0 * t + (68.0 / 37.0)) + (139.0 / 52.0) * sin(6.0 * t + (31.0 / 7.0)) + (160.0 / 61.0) * sin(7.0 * t + (69.0 / 43.0)) + (37.0 / 31.0) * sin(9.0 * t + (128.0 / 43.0)) + (33.0 / 67.0) * sin(10.0 * t + (14.0 / 17.0)) + (11.0 / 12.0) * sin(11.0 * t + (9.0 / 4.0)) + (13.0 / 33.0) * sin(12.0 * t + (69.0 / 59.0)) + (9.0 / 44.0) * sin(17.0 * t + (96.0 / 61.0)) + (17.0 / 36.0) * sin(18.0 * t + (1.0 / 40.0)) + (5.0 / 17.0) * sin(19.0 * t + (83.0 / 104.0)) + (5.0 / 18.0) * sin(20.0 * t + (7.0 / 10.0)) + (23.0 / 57.0) * sin(21.0 * t + (91.0 / 29.0)) + (5.0 / 37.0) * sin(22.0 * t + (5.0 / 3.0)) + (11.0 / 30.0) * sin(23.0 * t + (177.0 / 62.0)) + (2.0 / 21.0) * sin(24.0 * t + (63.0 / 17.0)) + (9.0 / 41.0) * sin(25.0 * t + (111.0 / 28.0)) + (4.0 / 33.0) * sin(26.0 * t + (159.0 / 44.0)) + (7.0 / 29.0) * sin(27.0 * t + (75.0 / 28.0)) + (2.0 / 9.0) * sin(28.0 * t + (134.0 / 89.0)) + (3.0 / 20.0) * sin(29.0 * t + (80.0 / 43.0)) + (1.0 / 20.0) * sin(30.0 * t + (71.0 / 30.0)) + (4.0 / 29.0) * sin(31.0 * t + (137.0 / 76.0)) + (1.0 / 53.0) * sin(32.0 * t + (34.0 / 29.0)) + (5.0 / 33.0) * sin(33.0 * t + (12.0 / 5.0)) + (4.0 / 27.0) * sin(34.0 * t + (7.0 / 23.0)) + (2.0 / 29.0) * sin(35.0 * t + (28.0 / 13.0)) + (2302.0 / 41.0)) * theta(19.0 * PI - t) * theta(t - 15.0 * PI) + (-(20.0 / 29.0) * sin((3.0 / 25.0) - 11.0 * t) - (53.0 / 25.0) * sin((17.0 / 16.0) - 7.0 * t) - (293.0 / 21.0) * sin((17.0 / 37.0) - 5.0 * t) - (853.0 / 43.0) * sin((107.0 / 71.0) - 3.0 * t) + (2467.0 / 29.0) * sin(t + (13.0 / 10.0)) + (307.0 / 9.0) * sin(2.0 * t + (85.0 / 41.0)) + (443.0 / 28.0) * sin(4.0 * t + (41.0 / 24.0)) + (127.0 / 27.0) * sin(6.0 * t + (181.0 / 41.0)) + (79.0 / 33.0) * sin(8.0 * t + (74.0 / 19.0)) + (173.0 / 69.0) * sin(9.0 * t + (341.0 / 146.0)) + (17.0 / 21.0) * sin(10.0 * t + (152.0 / 45.0)) + (41.0 / 31.0) * sin(12.0 * t + (110.0 / 29.0)) + (36.0 / 107.0) * sin(13.0 * t + (55.0 / 14.0)) + (27.0 / 34.0) * sin(14.0 * t + (41.0 / 12.0)) + (49.0 / 30.0) * sin(15.0 * t + (26.0 / 15.0)) + (5.0 / 4.0) * sin(16.0 * t + (8.0 / 15.0)) + (13.0 / 20.0) * sin(17.0 * t + (67.0 / 46.0)) + (11.0 / 12.0) * sin(18.0 * t + (31.0 / 37.0)) + (47.0 / 53.0) * sin(19.0 * t + (30.0 / 19.0)) + (35.0 / 36.0) * sin(20.0 * t + (21.0 / 19.0)) + (29.0 / 37.0) * sin(21.0 * t + (47.0 / 39.0)) + (23.0 / 30.0) * sin(22.0 * t + (32.0 / 23.0)) + (29.0 / 38.0) * sin(23.0 * t + (66.0 / 31.0)) + (7.0 / 11.0) * sin(24.0 * t + (42.0 / 37.0)) + (5.0 / 27.0) * sin(25.0 * t + (211.0 / 49.0)) + (5.0 / 23.0) * sin(26.0 * t + (141.0 / 49.0)) + (1.0 / 6.0) * sin(27.0 * t + (113.0 / 25.0)) + (11.0 / 37.0) * sin(28.0 * t + (152.0 / 83.0)) + (10.0 / 29.0) * sin(29.0 * t + (22.0 / 39.0)) + (14.0 / 69.0) * sin(30.0 * t + (17.0 / 22.0)) + (3.0 / 41.0) * sin(31.0 * t + (51.0 / 31.0)) + (7.0 / 23.0) * sin(32.0 * t + (61.0 / 28.0)) + (7.0 / 39.0) * sin(33.0 * t + (38.0 / 15.0)) + (5.0 / 19.0) * sin(34.0 * t + (47.0 / 18.0)) + (1.0 / 10.0) * sin(35.0 * t + (26.0 / 37.0)) + (5.0 / 24.0) * sin(36.0 * t + (171.0 / 41.0)) - (2471.0 / 81.0)) * theta(15.0 * PI - t) * theta(t - 11.0 * PI) + ( - (9.0 / 41.0) * sin((27.0 / 25.0) - 14.0 * t) - (9.0 / 16.0) * sin((67.0 / 46.0) - 12.0 * t) - (63.0 / 125.0) * sin((26.0 / 21.0) - 10.0 * t) - (4.0 / 23.0) * sin((16.0 / 43.0) - 9.0 * t) - (5.0 / 13.0) * sin((11.0 / 34.0) - 8.0 * t) + (319.0 / 6.0) * sin(t + (26.0 / 21.0)) + (51.0 / 28.0) * sin(2.0 * t + (58.0 / 21.0)) + (353.0 / 39.0) * sin(3.0 * t + (17.0 / 20.0)) + (23.0 / 16.0) * sin(4.0 * t + (9.0 / 35.0)) + (7.0 / 2.0) * sin(5.0 * t + (101.0 / 67.0)) + (31.0 / 29.0) * sin(6.0 * t + (19.0 / 33.0)) + (2.0 / 23.0) * sin(7.0 * t + (92.0 / 33.0)) + (7.0 / 23.0) * sin(11.0 * t + (31.0 / 52.0)) + (4.0 / 37.0) * sin(13.0 * t + (135.0 / 47.0)) + (2.0 / 29.0) * sin(15.0 * t + (206.0 / 55.0)) + (2534.0 / 25.0)) * theta(11.0 * PI - t) * theta(t - 7.0 * PI) + ( - (125.0 / 29.0) * sin((53.0 / 36.0) - 4.0 * t) - (845.0 / 12.0) * sin((5.0 / 29.0) - t) + (127.0 / 18.0) * sin(2.0 * t + (87.0 / 44.0)) + (334.0 / 35.0) * sin(3.0 * t + (61.0 / 31.0)) + (3.0 / 8.0) * sin(5.0 * t + (95.0 / 22.0)) + (27.0 / 14.0) * sin(6.0 * t + (39.0 / 32.0)) + (8.0 / 9.0) * sin(7.0 * t + (27.0 / 11.0)) + (14.0 / 9.0) * sin(8.0 * t + (131.0 / 36.0)) - (4169.0 / 40.0)) * theta(7.0 * PI - t) * theta(t - 3.0 * PI) + (-(17.0 / 31.0) * sin((3.0 / 16.0) - 42.0 * t) - (7.0 / 20.0) * sin((19.0 / 22.0) - 39.0 * t) - (12.0 / 31.0) * sin((48.0 / 37.0) - 38.0 * t) - (17.0 / 38.0) * sin((38.0 / 61.0) - 26.0 * t) - (50.0 / 29.0) * sin((203.0 / 204.0) - 25.0 * t) - (125.0 / 42.0) * sin((1.0 / 21.0) - 20.0 * t) - (34.0 / 31.0) * sin((28.0 / 33.0) - 19.0 * t) - (317.0 / 32.0) * sin((4.0 / 11.0) - 10.0 * t) - (277.0 / 33.0) * sin((53.0 / 40.0) - 9.0 * t) + (2468.0 / 19.0) * sin(t + (12.0 / 25.0)) + (1180.0 / 21.0) * sin(2.0 * t + (142.0 / 33.0)) + (1501.0 / 28.0) * sin(3.0 * t + (41.0 / 27.0)) + (281.0 / 39.0) * sin(4.0 * t + (41.0 / 29.0)) + (452.0 / 37.0) * sin(5.0 * t + (115.0 / 57.0)) + (725.0 / 49.0) * sin(6.0 * t + (184.0 / 67.0)) + (591.0 / 52.0) * sin(7.0 * t + (52.0 / 29.0)) + (289.0 / 25.0) * sin(8.0 * t + (141.0 / 53.0)) + (107.0 / 27.0) * sin(11.0 * t + (3.0 / 10.0)) + (281.0 / 46.0) * sin(12.0 * t + (104.0 / 33.0)) + (27.0 / 8.0) * sin(13.0 * t + (108.0 / 35.0)) + (15.0 / 23.0) * sin(14.0 * t + (43.0 / 18.0)) + (27.0 / 25.0) * sin(15.0 * t + (10.0 / 21.0)) + (73.0 / 34.0) * sin(16.0 * t + (99.0 / 35.0)) + (349.0 / 350.0) * sin(17.0 * t + (48.0 / 23.0)) + (18.0 / 19.0) * sin(18.0 * t + (137.0 / 68.0)) + (11.0 / 16.0) * sin(21.0 * t + (14.0 / 41.0)) + (28.0 / 17.0) * sin(22.0 * t + (85.0 / 22.0)) + (33.0 / 53.0) * sin(23.0 * t + (4.0 / 3.0)) + (21.0 / 32.0) * sin(24.0 * t + (7.0 / 3.0)) + (91.0 / 40.0) * sin(27.0 * t + (103.0 / 27.0)) + (10.0 / 7.0) * sin(28.0 * t + (58.0 / 13.0)) + (62.0 / 35.0) * sin(29.0 * t + (49.0 / 25.0)) + (41.0 / 29.0) * sin(30.0 * t + (87.0 / 35.0)) + (27.0 / 29.0) * sin(31.0 * t + (13.0 / 37.0)) + (8.0 / 17.0) * sin(32.0 * t + (49.0 / 48.0)) + (14.0 / 23.0) * sin(33.0 * t + (101.0 / 31.0)) + (2.0 / 25.0) * sin(34.0 * t + (26.0 / 33.0)) + (17.0 / 30.0) * sin(35.0 * t + (101.0 / 41.0)) + (11.0 / 38.0) * sin(36.0 * t + (2.0 / 33.0)) + (73.0 / 97.0) * sin(37.0 * t + (28.0 / 31.0)) + (11.0 / 27.0) * sin(40.0 * t + (167.0 / 111.0)) + (11.0 / 43.0) * sin(41.0 * t + (69.0 / 19.0)) + (1.0 / 37.0) * sin(43.0 * t + (43.0 / 38.0)) + (19.0 / 43.0) * sin(44.0 * t + (71.0 / 17.0)) + (10.0 / 23.0) * sin(45.0 * t + (38.0 / 9.0)) - (371.0 / 61.0)) * theta(3.0 * PI - t) * theta(t + PI)) * theta(sqrt(sgn(sin(t / 2.0))));
  return res;
}

float parametricY(float t)
{
  auto res = (((16.0 / 35.0) * sin(t + (11.0 / 7.0)) + (56.0 / 27.0) * sin(2.0 * t + (96.0 / 61.0)) + (22.0 / 27.0) * sin(3.0 * t + (52.0 / 33.0)) + (74.0 / 47.0) * sin(4.0 * t + (52.0 / 33.0)) + (13.0 / 32.0) * sin(5.0 * t + (67.0 / 42.0)) + (4093.0 / 22.0)) * theta(71.0 * PI - t) * theta(t - 67.0 * PI) + ( - (3.0 / 32.0) * sin((61.0 / 39.0) - 8.0 * t) + (341.0 / 32.0) * sin(t + (11.0 / 7.0)) + (11.0 / 14.0) * sin(2.0 * t + (47.0 / 10.0)) + (23.0 / 12.0) * sin(3.0 * t + (52.0 / 33.0)) + (3.0 / 20.0) * sin(4.0 * t + (53.0 / 33.0)) + (58.0 / 117.0) * sin(5.0 * t + (52.0 / 33.0)) + (3.0 / 38.0) * sin(6.0 * t + (61.0 / 13.0)) + (8.0 / 41.0) * sin(7.0 * t + (58.0 / 37.0)) + (3055.0 / 19.0)) * theta(67.0 * PI - t) * theta(t - 63.0 * PI) + ((111.0 / 10.0) * sin(t + (11.0 / 7.0)) + (10.0 / 29.0) * sin(2.0 * t + (202.0 / 43.0)) + (67.0 / 50.0) * sin(3.0 * t + (11.0 / 7.0)) + (1.0 / 32.0) * sin(4.0 * t + (639.0 / 137.0)) + (5035.0 / 31.0)) * theta(63.0 * PI - t) * theta(t - 59.0 * PI) + ( - (35.0 / 71.0) * sin((4.0 / 17.0) - 4.0 * t) - (35.0 / 34.0) * sin((53.0 / 52.0) - 3.0 * t) + (175.0 / 36.0) * sin(t + (123.0 / 44.0)) + (83.0 / 27.0) * sin(2.0 * t + (133.0 / 32.0)) + (13847.0 / 111.0)) * theta(59.0 * PI - t) * theta(t - 55.0 * PI) + ( - (38.0 / 39.0) * sin((19.0 / 14.0) - 17.0 * t) - (13.0 / 27.0) * sin((31.0 / 22.0) - 16.0 * t) - (49.0 / 39.0) * sin((31.0 / 33.0) - 13.0 * t) - (55.0 / 56.0) * sin((4.0 / 3.0) - 11.0 * t) - (76.0 / 51.0) * sin((6.0 / 29.0) - 8.0 * t) + (127.0 / 35.0) * sin(t + (190.0 / 67.0)) + (1061.0 / 78.0) * sin(2.0 * t + (61.0 / 33.0)) + (953.0 / 143.0) * sin(3.0 * t + (53.0 / 16.0)) + (48.0 / 29.0) * sin(4.0 * t + (33.0 / 20.0)) + (127.0 / 26.0) * sin(5.0 * t + (317.0 / 72.0)) + (281.0 / 36.0) * sin(6.0 * t + (107.0 / 39.0)) + (48.0 / 35.0) * sin(7.0 * t + (41.0 / 12.0)) + (1.0 / 8.0) * sin(9.0 * t + (3.0 / 34.0)) + (380.0 / 381.0) * sin(10.0 * t + (47.0 / 26.0)) + (27.0 / 31.0) * sin(12.0 * t + (86.0 / 35.0)) + (11.0 / 32.0) * sin(14.0 * t + (10.0 / 19.0)) + (15.0 / 22.0) * sin(15.0 * t + (11.0 / 27.0)) + (2.0 / 3.0) * sin(18.0 * t + (17.0 / 8.0)) + (2.0 / 29.0) * sin(19.0 * t + (181.0 / 40.0)) + (5.0 / 27.0) * sin(20.0 * t + (20.0 / 13.0)) - (14371.0 / 74.0)) * theta(55.0 * PI - t) * theta(t - 51.0 * PI) + ( - (14.0 / 27.0) * sin((31.0 / 23.0) - 35.0 * t) - (9.0 / 17.0) * sin((23.0 / 28.0) - 34.0 * t) - (5.0 / 14.0) * sin((18.0 / 13.0) - 28.0 * t) - (9.0 / 23.0) * sin((11.0 / 20.0) - 27.0 * t) - (14.0 / 29.0) * sin((33.0 / 46.0) - 26.0 * t) - (59.0 / 24.0) * sin((44.0 / 31.0) - 17.0 * t) - (137.0 / 73.0) * sin((15.0 / 22.0) - 16.0 * t) - (7.0 / 23.0) * sin((7.0 / 5.0) - 12.0 * t) - (137.0 / 73.0) * sin((11.0 / 19.0) - 10.0 * t) - (44.0 / 31.0) * sin((2.0 / 33.0) - 9.0 * t) - (2708.0 / 65.0) * sin((16.0 / 21.0) - 2.0 * t) - (818.0 / 31.0) * sin((29.0 / 33.0) - t) + (435.0 / 22.0) * sin(3.0 * t + (21.0 / 20.0)) + (113.0 / 24.0) * sin(4.0 * t + (124.0 / 27.0)) + (641.0 / 95.0) * sin(5.0 * t + (51.0 / 31.0)) + (61.0 / 15.0) * sin(6.0 * t + (39.0 / 11.0)) + (303.0 / 76.0) * sin(7.0 * t + (275.0 / 118.0)) + (140.0 / 29.0) * sin(8.0 * t + (127.0 / 29.0)) + (51.0 / 28.0) * sin(11.0 * t + (50.0 / 29.0)) + (43.0 / 40.0) * sin(13.0 * t + (67.0 / 43.0)) + (59.0 / 46.0) * sin(14.0 * t + (173.0 / 99.0)) + (67.0 / 35.0) * sin(15.0 * t + (31.0 / 24.0)) + (45.0 / 22.0) * sin(18.0 * t + (67.0 / 16.0)) + (24.0 / 19.0) * sin(19.0 * t + (20.0 / 9.0)) + (3.0 / 17.0) * sin(20.0 * t + (44.0 / 27.0)) + (18.0 / 31.0) * sin(21.0 * t + (49.0 / 34.0)) + (37.0 / 62.0) * sin(22.0 * t + (11.0 / 15.0)) + (13.0 / 31.0) * sin(23.0 * t + (115.0 / 67.0)) + (16.0 / 37.0) * sin(24.0 * t + (22.0 / 7.0)) + (4.0 / 35.0) * sin(25.0 * t + (26.0 / 33.0)) + (4.0 / 43.0) * sin(29.0 * t + (79.0 / 17.0)) + (11.0 / 37.0) * sin(30.0 * t + (383.0 / 85.0)) + (8.0 / 35.0) * sin(31.0 * t + (259.0 / 97.0)) + (9.0 / 20.0) * sin(32.0 * t + (27.0 / 10.0)) + (22.0 / 37.0) * sin(33.0 * t + (26.0 / 15.0)) + (5589.0 / 19.0)) * theta(51.0 * PI - t) * theta(t - 47.0 * PI) + ( - (101.0 / 30.0) * sin((23.0 / 15.0) - 3.0 * t) + (177.0 / 19.0) * sin(t + (63.0 / 38.0)) + (73.0 / 19.0) * sin(2.0 * t + (58.0 / 15.0)) + (50.0 / 33.0) * sin(4.0 * t + (51.0 / 14.0)) + (5.0 / 17.0) * sin(5.0 * t + (541.0 / 135.0)) + (29.0 / 35.0) * sin(6.0 * t + (125.0 / 29.0)) + (31.0 / 52.0) * sin(7.0 * t + (181.0 / 41.0)) + (7.0 / 12.0) * sin(8.0 * t + (122.0 / 35.0)) + (3986.0 / 25.0)) * theta(47.0 * PI - t) * theta(t - 43.0 * PI) + ( - (2.0 / 25.0) * sin((13.0 / 34.0) - 7.0 * t) - (3.0 / 26.0) * sin((9.0 / 8.0) - 4.0 * t) + (430.0 / 17.0) * sin(t + (6.0 / 31.0)) + (24.0 / 37.0) * sin(2.0 * t + (137.0 / 35.0)) + (50.0 / 37.0) * sin(3.0 * t + (26.0 / 23.0)) + (4.0 / 45.0) * sin(5.0 * t + (268.0 / 161.0)) + (7.0 / 20.0) * sin(6.0 * t + (19.0 / 6.0)) + (8835.0 / 43.0)) * theta(43.0 * PI - t) * theta(t - 39.0 * PI) + ( - (11.0 / 50.0) * sin((46.0 / 55.0) - 5.0 * t) + (345.0 / 13.0) * sin(t + (1.0 / 10.0)) + (67.0 / 41.0) * sin(2.0 * t + (90.0 / 29.0)) + (5.0 / 2.0) * sin(3.0 * t + (2.0 / 19.0)) + (39.0 / 79.0) * sin(4.0 * t + (565.0 / 141.0)) + (23.0 / 42.0) * sin(6.0 * t + (67.0 / 22.0)) + (6008.0 / 29.0)) * theta(39.0 * PI - t) * theta(t - 35.0 * PI) + ( - (21.0 / 53.0) * sin((74.0 / 73.0) - 15.0 * t) - (15.0 / 22.0) * sin((78.0 / 67.0) - 14.0 * t) - (291.0 / 104.0) * sin((1.0 / 14.0) - 7.0 * t) - (4561.0 / 456.0) * sin((2.0 / 17.0) - t) + (107.0 / 44.0) * sin(2.0 * t + (46.0 / 29.0)) + (45.0 / 22.0) * sin(3.0 * t + (128.0 / 51.0)) + (553.0 / 32.0) * sin(4.0 * t + (144.0 / 31.0)) + (25.0 / 16.0) * sin(5.0 * t + (127.0 / 37.0)) + (53.0 / 30.0) * sin(6.0 * t + (129.0 / 29.0)) + (1.0 / 11.0) * sin(8.0 * t + (60.0 / 31.0)) + (36.0 / 23.0) * sin(9.0 * t + (107.0 / 42.0)) + (61.0 / 37.0) * sin(10.0 * t + (141.0 / 32.0)) + (26.0 / 25.0) * sin(11.0 * t + (13.0 / 45.0)) + (7.0 / 23.0) * sin(12.0 * t + (64.0 / 51.0)) + (6.0 / 23.0) * sin(13.0 * t + (113.0 / 45.0)) + (7673.0 / 35.0)) * theta(35.0 * PI - t) * theta(t - 31.0 * PI) + ( - (4.0 / 27.0) * sin((12.0 / 17.0) - 12.0 * t) - (4.0 / 15.0) * sin((35.0 / 44.0) - 10.0 * t) - (5.0 / 31.0) * sin((4.0 / 37.0) - 8.0 * t) - (10.0 / 39.0) * sin((43.0 / 65.0) - 6.0 * t) + (493.0 / 19.0) * sin(t + (239.0 / 54.0)) + (7.0 / 13.0) * sin(2.0 * t + (125.0 / 48.0)) + (65.0 / 16.0) * sin(3.0 * t + (95.0 / 23.0)) + (16.0 / 39.0) * sin(4.0 * t + (15.0 / 41.0)) + (5.0 / 14.0) * sin(5.0 * t + (77.0 / 31.0)) + (54.0 / 163.0) * sin(7.0 * t + (181.0 / 45.0)) + (9.0 / 55.0) * sin(9.0 * t + (47.0 / 19.0)) + (4.0 / 47.0) * sin(11.0 * t + (126.0 / 29.0)) + (7332.0 / 43.0)) * theta(31.0 * PI - t) * theta(t - 27.0 * PI) + ( - (30.0 / 91.0) * sin((3.0 / 16.0) - 7.0 * t) - (20.0 / 79.0) * sin((37.0 / 28.0) - 5.0 * t) + (247.0 / 11.0) * sin(t + (88.0 / 23.0)) + (23.0 / 17.0) * sin(2.0 * t + (140.0 / 37.0)) + (461.0 / 123.0) * sin(3.0 * t + (55.0 / 26.0)) + (16.0 / 31.0) * sin(4.0 * t + (36.0 / 11.0)) + (50.0 / 149.0) * sin(6.0 * t + (55.0 / 54.0)) + (3.0 / 34.0) * sin(8.0 * t + (212.0 / 77.0)) + (9.0 / 43.0) * sin(9.0 * t + (1.0 / 25.0)) + (5.0 / 33.0) * sin(10.0 * t + (107.0 / 35.0)) + (1817.0 / 11.0)) * theta(27.0 * PI - t) * theta(t - 23.0 * PI) + ( - (14.0 / 29.0) * sin((99.0 / 85.0) - 6.0 * t) - (1.0 / 20.0) * sin((14.0 / 15.0) - 3.0 * t) - (4823.0 / 38.0) * sin((1.0 / 17.0) - t) + (37.0 / 31.0) * sin(2.0 * t + (101.0 / 27.0)) + (212.0 / 213.0) * sin(4.0 * t + (25.0 / 17.0)) + (14.0 / 37.0) * sin(5.0 * t + (119.0 / 53.0)) + (15.0 / 44.0) * sin(7.0 * t + (13.0 / 51.0)) + (6158.0 / 33.0)) * theta(23.0 * PI - t) * theta(t - 19.0 * PI) + ( - (5.0 / 31.0) * sin((83.0 / 82.0) - 35.0 * t) - (3.0 / 26.0) * sin((51.0 / 35.0) - 33.0 * t) - (4.0 / 33.0) * sin((22.0 / 51.0) - 31.0 * t) - (5.0 / 22.0) * sin((10.0 / 23.0) - 29.0 * t) - (31.0 / 61.0) * sin((4.0 / 21.0) - 17.0 * t) - (222.0 / 35.0) * sin((21.0 / 19.0) - 5.0 * t) + (2486.0 / 43.0) * sin(t + (78.0 / 17.0)) + (684.0 / 31.0) * sin(2.0 * t + (17.0 / 20.0)) + (411.0 / 32.0) * sin(3.0 * t + (49.0 / 17.0)) + (5.0 / 41.0) * sin(4.0 * t + (4.0 / 27.0)) + (61.0 / 13.0) * sin(6.0 * t + (113.0 / 25.0)) + (48.0 / 25.0) * sin(7.0 * t + (39.0 / 35.0)) + (206.0 / 61.0) * sin(8.0 * t + (5.0 / 23.0)) + (11.0 / 24.0) * sin(9.0 * t + (23.0 / 36.0)) + (107.0 / 106.0) * sin(10.0 * t + (5.0 / 3.0)) + (67.0 / 33.0) * sin(11.0 * t + (51.0 / 23.0)) + (41.0 / 17.0) * sin(12.0 * t + (53.0 / 25.0)) + (117.0 / 34.0) * sin(13.0 * t + (50.0 / 29.0)) + (81.0 / 28.0) * sin(14.0 * t + (29.0 / 28.0)) + (43.0 / 27.0) * sin(15.0 * t + (25.0 / 56.0)) + (32.0 / 37.0) * sin(16.0 * t + (5.0 / 26.0)) + (10.0 / 27.0) * sin(18.0 * t + (158.0 / 43.0)) + (34.0 / 61.0) * sin(19.0 * t + (37.0 / 21.0)) + (24.0 / 49.0) * sin(20.0 * t + (31.0 / 27.0)) + (1.0 / 4.0) * sin(21.0 * t + (132.0 / 79.0)) + (11.0 / 38.0) * sin(22.0 * t + (37.0 / 30.0)) + (8.0 / 31.0) * sin(23.0 * t + (119.0 / 26.0)) + (5.0 / 18.0) * sin(24.0 * t + (109.0 / 34.0)) + (4.0 / 19.0) * sin(25.0 * t + (8.0 / 25.0)) + (3.0 / 23.0) * sin(26.0 * t + (25.0 / 21.0)) + (7.0 / 27.0) * sin(27.0 * t + (2.0 / 19.0)) + (4.0 / 23.0) * sin(28.0 * t + (43.0 / 25.0)) + (19.0 / 75.0) * sin(30.0 * t + (43.0 / 14.0)) + (8.0 / 63.0) * sin(32.0 * t + (109.0 / 24.0)) + (1.0 / 60.0) * sin(34.0 * t + (23.0 / 42.0)) - (615.0 / 34.0)) * theta(19.0 * PI - t) * theta(t - 15.0 * PI) + ( - (1.0 / 23.0) * sin((8.0 / 13.0) - 33.0 * t) - (6.0 / 19.0) * sin((337.0 / 336.0) - 28.0 * t) - (1.0 / 34.0) * sin((13.0 / 34.0) - 27.0 * t) - (11.0 / 16.0) * sin((9.0 / 11.0) - 24.0 * t) - (49.0 / 74.0) * sin((34.0 / 29.0) - 23.0 * t) - (41.0 / 36.0) * sin((77.0 / 78.0) - 22.0 * t) - (35.0 / 27.0) * sin((91.0 / 92.0) - 21.0 * t) - (40.0 / 27.0) * sin((57.0 / 43.0) - 19.0 * t) - (1.0 / 2.0) * sin((6.0 / 49.0) - 14.0 * t) - (31.0 / 34.0) * sin((39.0 / 29.0) - 11.0 * t) - (27.0 / 14.0) * sin((53.0 / 37.0) - 5.0 * t) - (79.0 / 7.0) * sin((9.0 / 29.0) - 4.0 * t) - (597.0 / 20.0) * sin((11.0 / 21.0) - t) + (823.0 / 33.0) * sin(2.0 * t + (35.0 / 29.0)) + (281.0 / 17.0) * sin(3.0 * t + (170.0 / 43.0)) + (1805.0 / 258.0) * sin(6.0 * t + (65.0 / 21.0)) + (293.0 / 55.0) * sin(7.0 * t + (102.0 / 47.0)) + (323.0 / 108.0) * sin(8.0 * t + (5.0 / 6.0)) + (20.0 / 11.0) * sin(9.0 * t + (196.0 / 43.0)) + (27.0 / 29.0) * sin(10.0 * t + (89.0 / 21.0)) + (21.0 / 8.0) * sin(12.0 * t + (29.0 / 22.0)) + (103.0 / 49.0) * sin(13.0 * t + (32.0 / 53.0)) + (27.0 / 25.0) * sin(15.0 * t + (83.0 / 34.0)) + (18.0 / 25.0) * sin(16.0 * t + (91.0 / 31.0)) + (55.0 / 39.0) * sin(17.0 * t + (167.0 / 40.0)) + (233.0 / 232.0) * sin(18.0 * t + (99.0 / 23.0)) + (29.0 / 24.0) * sin(20.0 * t + (51.0 / 11.0)) + (9.0 / 20.0) * sin(25.0 * t + (142.0 / 31.0)) + (2.0 / 29.0) * sin(26.0 * t + (85.0 / 28.0)) + (9.0 / 40.0) * sin(29.0 * t + (73.0 / 18.0)) + (5.0 / 27.0) * sin(30.0 * t + (47.0 / 13.0)) + (2.0 / 7.0) * sin(31.0 * t + (31.0 / 11.0)) + (7.0 / 26.0) * sin(32.0 * t + (53.0 / 32.0)) + (22.0 / 87.0) * sin(34.0 * t + (93.0 / 26.0)) + (5.0 / 46.0) * sin(35.0 * t + (233.0 / 70.0)) + (3.0 / 22.0) * sin(36.0 * t + (87.0 / 19.0)) + (346.0 / 27.0)) * theta(15.0 * PI - t) * theta(t - 11.0 * PI) + ( - (3.0 / 35.0) * sin((41.0 / 28.0) - 14.0 * t) - (14.0 / 33.0) * sin((40.0 / 53.0) - 9.0 * t) - (38.0 / 51.0) * sin((41.0 / 47.0) - 7.0 * t) - (91.0 / 11.0) * sin((8.0 / 13.0) - 3.0 * t) - (2058.0 / 25.0) * sin((44.0 / 35.0) - t) + (26.0 / 29.0) * sin(2.0 * t + (23.0 / 9.0)) + (41.0 / 31.0) * sin(4.0 * t + (41.0 / 62.0)) + (5.0 / 4.0) * sin(5.0 * t + (1.0 / 18.0)) + (87.0 / 88.0) * sin(6.0 * t + (69.0 / 53.0)) + (17.0 / 39.0) * sin(8.0 * t + (74.0 / 35.0)) + (33.0 / 98.0) * sin(10.0 * t + (113.0 / 31.0)) + (8.0 / 29.0) * sin(11.0 * t + (1.0 / 176.0)) + (17.0 / 47.0) * sin(12.0 * t + (64.0 / 15.0)) + (2.0 / 15.0) * sin(13.0 * t + (208.0 / 83.0)) + (3.0 / 26.0) * sin(15.0 * t + (48.0 / 17.0)) - (3394.0 / 23.0)) * theta(11.0 * PI - t) * theta(t - 7.0 * PI) + ( - (27.0 / 37.0) * sin((37.0 / 34.0) - 7.0 * t) - (29.0 / 8.0) * sin((3.0 / 16.0) - 4.0 * t) - (77.0 / 13.0) * sin((3.0 / 31.0) - 3.0 * t) - (3113.0 / 38.0) * sin((44.0 / 45.0) - t) + (96.0 / 11.0) * sin(2.0 * t + (159.0 / 38.0)) + (49.0 / 82.0) * sin(5.0 * t + (21.0 / 8.0)) + (73.0 / 37.0) * sin(6.0 * t + (25.0 / 27.0)) + (31.0 / 33.0) * sin(8.0 * t + (59.0 / 26.0)) - (3567.0 / 28.0)) * theta(7.0 * PI - t) * theta(t - 3.0 * PI) + ( - (11.0 / 36.0) * sin((40.0 / 27.0) - 45.0 * t) - (9.0 / 19.0) * sin((14.0 / 31.0) - 41.0 * t) - (10.0 / 27.0) * sin((31.0 / 26.0) - 33.0 * t) - (8.0 / 11.0) * sin((31.0 / 24.0) - 31.0 * t) - (13.0 / 10.0) * sin((13.0 / 48.0) - 29.0 * t) - (66.0 / 25.0) * sin((48.0 / 43.0) - 23.0 * t) - (29.0 / 14.0) * sin((53.0 / 66.0) - 19.0 * t) - (129.0 / 34.0) * sin((2.0 / 31.0) - 14.0 * t) - (77.0 / 46.0) * sin((15.0 / 22.0) - 13.0 * t) - (47.0 / 41.0) * sin((4.0 / 15.0) - 12.0 * t) - (393.0 / 38.0) * sin((24.0 / 31.0) - 7.0 * t) + (3862.0 / 51.0) * sin(t + (146.0 / 31.0)) + (1101.0 / 8.0) * sin(2.0 * t + (78.0 / 29.0)) + (329.0 / 22.0) * sin(3.0 * t + (67.0 / 26.0)) + (246.0 / 25.0) * sin(4.0 * t + (32.0 / 13.0)) + (596.0 / 49.0) * sin(5.0 * t + (101.0 / 32.0)) + (41.0 / 10.0) * sin(6.0 * t + (31.0 / 18.0)) + (287.0 / 45.0) * sin(8.0 * t + (27.0 / 35.0)) + (172.0 / 29.0) * sin(9.0 * t + (66.0 / 19.0)) + (311.0 / 40.0) * sin(10.0 * t + (143.0 / 37.0)) + (97.0 / 20.0) * sin(11.0 * t + (56.0 / 29.0)) + (160.0 / 39.0) * sin(15.0 * t + (377.0 / 94.0)) + (77.0 / 25.0) * sin(16.0 * t + (31.0 / 30.0)) + (74.0 / 25.0) * sin(17.0 * t + (47.0 / 17.0)) + (15.0 / 14.0) * sin(18.0 * t + (113.0 / 35.0)) + (37.0 / 20.0) * sin(20.0 * t + (23.0 / 29.0)) + (24.0 / 47.0) * sin(21.0 * t + (74.0 / 27.0)) + (28.0 / 41.0) * sin(22.0 * t + (135.0 / 32.0)) + (19.0 / 20.0) * sin(24.0 * t + (199.0 / 149.0)) + (33.0 / 67.0) * sin(25.0 * t + (148.0 / 43.0)) + (47.0 / 36.0) * sin(26.0 * t + (55.0 / 28.0)) + (13.0 / 10.0) * sin(27.0 * t + (71.0 / 33.0)) + (19.0 / 17.0) * sin(28.0 * t + (47.0 / 11.0)) + (25.0 / 27.0) * sin(30.0 * t + (35.0 / 39.0)) + (5.0 / 18.0) * sin(32.0 * t + (6.0 / 23.0)) + (11.0 / 29.0) * sin(34.0 * t + (59.0 / 19.0)) + (23.0 / 33.0) * sin(35.0 * t + (173.0 / 72.0)) + (16.0 / 31.0) * sin(36.0 * t + (67.0 / 19.0)) + (9.0 / 31.0) * sin(37.0 * t + (6.0 / 29.0)) + (7.0 / 25.0) * sin(38.0 * t + (25.0 / 12.0)) + (19.0 / 31.0) * sin(39.0 * t + (135.0 / 29.0)) + (21.0 / 53.0) * sin(40.0 * t + (21.0 / 34.0)) + (1.0 / 14.0) * sin(42.0 * t + (24.0 / 13.0)) + (17.0 / 32.0) * sin(43.0 * t + (35.0 / 34.0)) + (27.0 / 43.0) * sin(44.0 * t + (107.0 / 31.0)) - (9223.0 / 25.0)) * theta(3.0 * PI - t) * theta(t + PI)) * theta(sqrt(sgn(sin(t / 2.0))));
  return res;
}


// отрисовка кривой
void drawPSY(Canvas c)
{
  for(float i = 0.0f; i < 72 * PI; i += 0.01)
  {
    auto X = cast(int) (250 - 0.4 * parametricX(i));
    auto Y = cast(int) (250 - 0.4 * parametricY(i));
    drawPoint(c, X, Y);
  }
}


class MainForm : Form
{
    public this()
    {
        this.text = "";
        this.size = Size(500, 550);
        this.startPosition = FormStartPosition.centerScreen;
    };

    protected override void onPaint(PaintEventArgs e)
    {

        Canvas c = e.canvas;
        c.drawPSY();

        super.onPaint(e);
    }
};


int main(string[] args)
{
    return Application.run(new MainForm());
}

Это простой проект для DGui: создаем пустой проект dub и в файл app.d добавляем выше приведенный код.

После компиляции и запуска вы можете лицезреть самолично результат таких громадных формул (которых всего три):

Добавить комментарий