1

Introduction

Following the star line , then try the bicorn.

Introduction

The double diagonal is also called the cocked-ha curve, which is the name of a set of quartic curves studied by Sylvester Cayley studied the same curve in 1867.

89-1

Formula description in Cartesian coordinate system:

89-2

Where a is a constant.

draw

Parametric conversion:

89-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 = 40;
  while (start <= max) {
    x = a * Math.sin(start);
    const yNumerator = a * Math.pow(Math.cos(start), 2) * (2 + Math.cos(start));
    const yDenominator = 3 + Math.pow(Math.sin(start), 2);
    y = yNumerator / yDenominator;
    points.push([x, y]);
    start = start + acceleration;
  }
  // 实现把点绘制成线的方法
  line({ points: points});
}

Reference


XXHolic
363 声望1.1k 粉丝

[链接]