This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function rotating_squares(n_squares) | |
| %ROTATING_SQUARES Animate a chain of N squares linked at corners. | |
| % | |
| % Geometry | |
| % -------- | |
| % Each child square has sides 1/3 of its parent. One corner of the child | |
| % is pinned to the top-right corner of the parent and rotates about that | |
| % pivot. The child's angular speed is 3× the parent's, matching the | |
| % 1:3 perimeter ratio (rolling-contact analogy for squares). | |
| % |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using ModelingToolkit, OrdinaryDiffEq | |
| include(joinpath(@__DIR__, "parameters.jl")) | |
| # Independent variable | |
| @independent_variableusing ModelingToolkit, OrdinaryDiffEq | |
| include(joinpath(@__DIR__, "parameters.jl")) | |
| # Independent variable | |
| @independent_variables t |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # circular_equations.jl | |
| # Numerical verification for "Circular Functions" — Wild Peaches | |
| # Requires: Pkg.add("Polynomials") | |
| using Polynomials | |
| # ── 1. Cubic 3z³ − 9z² + 6z − 1 = 0, z = x² ────────────────── | |
| p = Polynomial([-1.0, 6.0, -9.0, 3.0]) # coefficients constant-first | |
| z_poly = sort(real.(roots(p))) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example.buckarootime | |
| import android.Manifest | |
| import android.content.pm.PackageManager | |
| import android.os.Bundle | |
| import android.os.Looper | |
| import androidx.activity.ComponentActivity | |
| import androidx.activity.compose.setContent | |
| import androidx.activity.result.contract.ActivityResultContracts | |
| import androidx.compose.foundation.layout.* |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #= | |
| Solves a geometry problem using linear algebra and Heron's formula | |
| See: Red Flag Day Geometry | |
| using Revise | |
| Load with: includet("redflag.jl") | |
| =# | |
| using LinearAlgebra |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| The PI License | |
| Finds a four digit prime number n such that n is | |
| - Balanced: A prime equidistant from the previous and subsequent prime numbers. | |
| - Odious: A number is odious if the binary representation of the number as an odd number of 1's, and is evil if the number of 1's is even. | |
| - Happy: Add the squares of the digits to get a new number. Continue the process and if you ever get to $1$, the original number is happy. | |
| - Apocalyptic: If 2^n contains the sequence 666, then n is apocalyptic. | |
| Author: John Peach |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Gmsh project created on Mon Jun 17, 2024 | |
| SetFactory("OpenCASCADE"); | |
| // Define points | |
| L = 0.5; // Tube length | |
| H = 0.05; // Tube width | |
| N = 10; // Number of rectangles along length of the tube | |
| Point(1) = {0, 0, 0, 1.0}; | |
| Point(2) = {L, 0, 0, 1.0}; | |
| Point(3) = {L, H, 0, 1.0}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Shape parameters | |
| sphereRadius = 0.65; | |
| cylinderRadius = 0.3; | |
| cylinderHeight = 1.1; | |
| // Top level difference operation | |
| difference(){ | |
| // Intersection of cube and sphere | |
| intersection(){ |
NewerOlder