Star

Import

import { star } from "@sarmal/core/curves/star";

A 5-pointed star shape built from Fourier harmonics in polar coordinates.

Equation

r=cos ⁣(52t)+0.35cos ⁣(152t)+0.15cos ⁣(252t)x=rcos(t)y=rsin(t)\begin{aligned}r = \left|\cos\!\left(\tfrac{5}{2}t\right)\right| + 0.35\left|\cos\!\left(\tfrac{15}{2}t\right)\right| + 0.15\left|\cos\!\left(\tfrac{25}{2}t\right)\right| &\\x = r\cos(t) &\\y = r\sin(t) &\end{aligned}

Parameters

Family Fourier polar
Period
Default Speed 1
Skeleton static

Key Features

  • 5 sharp tips from the fundamental frequency
  • Two higher harmonics sharpen the tips and add subtle texture
  • Fully closed in a single revolution

Usage

Standard

import { createSarmal } from "@sarmal/core";
import { star } from "@sarmal/core/curves/star";

const canvas = document.getElementById("spinner") as HTMLCanvasElement;
const sarmal = createSarmal(canvas, star);

React

import { Sarmal } from "@sarmal/react";
import { star } from "@sarmal/core/curves/star";

function App() {
  return <Sarmal curve={star} />;
}