1

Introduction

Following interlocking spiral , then try the star line (Astroid).

Introduction

88-1

Johann Bernoulli first discussed star lines in 1691-1692. It also appears in Leibniz 1715 years of letters. It is sometimes called the quadricuspid valve, obviously because it has four cusps.

Astroid didn't get its current name in a book published in Vienna until 1836. Even after 1836, various names appeared in the literature, including cubocycloid and paracycle.

The formula is described in the Cartesian coordinate system:

88-2

Where a is a constant.

draw

Parametric conversion:

88-3

This is the example , drawing the main logic code:

function draw() {
  let a = 100, start = 0;
  let x = 0, y = 0, points = [];
  const acceleration = 0.1, max = 20;
  while (start <= max) {
    x = a * Math.pow(Math.cos(start), 3);
    y = a * Math.pow(Math.sin(start), 3);
    points.push([x, y]);
    start = start + acceleration;
  }
  // 实现把点绘制成线的方法
  line({ points: points});
}

Reference


XXHolic
363 声望1.1k 粉丝

[链接]