Skip to content

Instantly share code, notes, and snippets.

View app.js
"use strict"
window.onload = function()
{
arc();
// pieSlice();
// pieChart();
View svgarcandpieslice.js
"use strict"
function drawArc(settings)
{
let d = "";
const firstCircumferenceX = settings.centreX + settings.radius * Math.cos(settings.startAngleRadians);
const firstCircumferenceY = settings.centreY + settings.radius * Math.sin(settings.startAngleRadians);
const secondCircumferenceX = settings.centreX + settings.radius * Math.cos(settings.startAngleRadians + settings.sweepAngleRadians);
View svgarcandpieslice.html
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>SVG Arc and Pie Slice</title>
</head>
</body>
View parametricequationspage.js
"use strict"
window.onload = function()
{
const plotter = new ParametricEquationsPlotter();
const pe = ParametricEquations.circle;
// const pe = ParametricEquations.ellipse;
// const pe = ParametricEquations.cardioid;
// const pe = ParametricEquations.spiral;
View parametricequations.js
const ParametricEquations =
{
circle:
{
xFunction: function (t) {return Math.cos(t)},
yFunction: function (t) {return Math.sin(t)},
zFunction: function (t) {return 0},
tRange: {start: 0, end: 2 * Math.PI},
tStep: Math.PI / 32,
colour: "#FF0000"
@CodeDrome
CodeDrome / parametricequationsplotter.js
Created Oct 8, 2021
parametricequationsplotter.js
View parametricequationsplotter.js
class ParametricEquationsPlotter
{
constructor()
{
this._container = null,
this._renderer = null,
this._scene = null,
this._light = null,
this._camera = null,
this._group = null,
View parametricequations.htm
<!DOCTYPE html>
<html lang="en">
<head>
<title>CodeDrome - Parametric Equations</title>
<meta charset="utf-8" />
<link href="projects.css" rel="stylesheet" />
</head>
View animatedsvgbezier.js
"use strict"
window.onload = function()
{
bezier();
}
function randomPosition(max)
@CodeDrome
CodeDrome / animatedsvgbezierlibrary.js
Created Sep 13, 2021
animatedsvgbezierlibrary.js
View animatedsvgbezierlibrary.js
class AnimatedSVGBezier
{
static #generatePath(points, relative)
{
let type = null;
if(points.length === 3)
{
type = "Q";
}
View svgbezier.js
const APP = {};
window.onload = function()
{
APP.svgelement = document.getElementById("svg");
gridLines();
threePoint();