Lamé Curve

Import

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

A superellipse that morphs continuously between diamond, circle, and squircle shapes as the exponent oscillates.

Equation

x=sgn(cost)costpy=sgn(sint)sintpwhere p=1.75+1.25sin(ttime0.48)\begin{aligned}x = \operatorname{sgn}(\cos t)\,|\cos t|^{p} &\\y = \operatorname{sgn}(\sin t)\,|\sin t|^{p} &\\\text{where } p = 1.75 + 1.25\sin(t_{\text{time}} \cdot 0.48) &\end{aligned}

Parameters

Family Superellipse
Period
Default Speed 1
Skeleton live

Key Features

  • Morphs between diamond, circle, and squircle
  • Exponent p oscillates between 0.5 and 3.0
  • Live skeleton shifts continuously

Usage

Standard

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

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

React

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

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