In the differential geometry of curves, a roulette is a kind of curve, generalizing cycloids, epicycloids, hypocycloids, trochoids, and involutes.
This p5.js sketch implements hypotrochoid and epicycloid roulettes.
| package main | |
| import ( | |
| "fmt" | |
| "math" | |
| "os" | |
| "time" | |
| "github.com/fogleman/fauxgl" | |
| embree "github.com/fogleman/go-embree" |
| import heapq | |
| def estimated_distance(node, target): | |
| x1, y1 = node | |
| x2, y2 = target | |
| dx, dy = abs(x1 - x2), abs(y1 - y2) | |
| dist = dx + dy | |
| return dist | |
| def shortest_path(graph, source, target, heuristic_func=None): |
| from imposm.parser import OSMParser | |
| from shapely import geometry, ops | |
| import axi | |
| import math | |
| import sys | |
| # put your lat/lng here | |
| LAT, LNG = 0, 0 |
| app that ages you | |
| app that answers questions | |
| app that adds music to videos | |
| app that automatically saves money | |
| app that adds text to pictures | |
| app that allows you to write on pdf | |
| app that asks you questions | |
| app that answers math word problems | |
| app that allows you to use school wifi | |
| app that allows you to draw on photos |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <style>body {padding: 0; margin: 0; overflow: hidden;}</style> | |
| </head> | |
| <body> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.5/p5.min.js"></script> | |
| <script src="pieces.js"></script> |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <style>body {padding: 0; margin: 0; overflow: hidden;}</style> | |
| </head> | |
| <body> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.5/p5.min.js"></script> | |
| <script src="pieces.js"></script> |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <style>body {padding: 0; margin: 0; overflow: hidden;}</style> | |
| </head> | |
| <body> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.5/p5.min.js"></script> | |
| <script src="pieces.js"></script> |
| from __future__ import division | |
| def meet(x, vi, vf, a): | |
| x1 = (2 * a * x + vi * vi - vf * vf) / (4 * a) | |
| x2 = x - x1 | |
| v = (vi * vi + 2 * a * x1) ** 0.5 | |
| t1 = (v - vi) / a | |
| t2 = (vf - v) / -a | |
| cx1 = vi * t1 + 0.5 * a * t1 * t1 | |
| cx2 = v * t2 + 0.5 * -a * t2 * t2 |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <style>body {padding: 0; margin: 0; overflow: hidden;}</style> | |
| </head> | |
| <body> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.6.2/dat.gui.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.5/p5.min.js"></script> |
In the differential geometry of curves, a roulette is a kind of curve, generalizing cycloids, epicycloids, hypocycloids, trochoids, and involutes.
This p5.js sketch implements hypotrochoid and epicycloid roulettes.