Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
16d73d3
Update proj1.html
ShayneGeo Mar 15, 2024
9d9dc3f
Update proj2.html
ShayneGeo Mar 15, 2024
1a60309
Update proj3.html
ShayneGeo Mar 15, 2024
71ce3af
Create proj4.html
ShayneGeo Mar 20, 2024
e2e84e7
Update projects.html
ShayneGeo Mar 20, 2024
5214749
Update projects.html
ShayneGeo Mar 20, 2024
9c7aee4
Update index.html
ShayneGeo Mar 20, 2024
6bcfb4a
Update index.html
ShayneGeo Mar 20, 2024
c37314f
Update proj4.html
ShayneGeo Mar 27, 2024
eff71bd
Update projects.html
ShayneGeo Mar 27, 2024
ada29fd
Update projects.html
ShayneGeo Mar 28, 2024
50da4b8
Create proj5.html
ShayneGeo Mar 28, 2024
6222d30
Create proj6.html
ShayneGeo Mar 28, 2024
7212e4b
Update proj6.html
ShayneGeo Mar 28, 2024
3cccc98
Create interests.html
ShayneGeo Jun 3, 2024
1079ca7
Update index.html
ShayneGeo Jun 3, 2024
cf01000
Update interests.html
ShayneGeo Jun 3, 2024
d2dc315
Create inter1.html
ShayneGeo Jun 3, 2024
d0d468a
Create inter2.html
ShayneGeo Jun 3, 2024
3363adf
Update interests.html
ShayneGeo Jun 3, 2024
8b3b409
Add files via upload
ShayneGeo Jun 3, 2024
64fe5d4
Update inter1.html
ShayneGeo Jun 3, 2024
c545fad
Update inter1.html
ShayneGeo Jun 3, 2024
55895f8
Update inter2.html
ShayneGeo Jun 3, 2024
3a9db09
Update inter1.html
ShayneGeo Jun 3, 2024
da4c95c
Add files via upload
ShayneGeo Jun 3, 2024
d52f92a
Update inter2.html
ShayneGeo Jun 3, 2024
1e8d44b
Update interests.html
ShayneGeo Jun 3, 2024
82d0c97
Update inter2.html
ShayneGeo Jun 3, 2024
13633cd
Update inter1.html
ShayneGeo Jun 3, 2024
9e66dee
Update projects.html
ShayneGeo Jun 3, 2024
70a9ce5
Update projects.html
ShayneGeo Jun 3, 2024
cc6c995
Update index.html
ShayneGeo Jun 3, 2024
e62412d
Update index.html
ShayneGeo Jun 3, 2024
fd18073
Update index.html
ShayneGeo Jun 3, 2024
9232f99
Update README.md
ShayneGeo Jun 3, 2024
6538f84
Update inter2.html
ShayneGeo Jun 3, 2024
1944afa
Delete 02a9c0651aca4ccbaacd2d8821bdf237.MOV
ShayneGeo Jun 3, 2024
7fcfa6f
Create code.html
ShayneGeo Jun 3, 2024
c2bf51c
Update index.html
ShayneGeo Jun 3, 2024
1a098fe
Update code.html
ShayneGeo Jun 3, 2024
fb422cb
Update code.html
ShayneGeo Jun 3, 2024
cadaf9a
Update code.html
ShayneGeo Jun 3, 2024
b60de46
Update code.html
ShayneGeo Jun 3, 2024
0e0cfbc
Update code.html
ShayneGeo Jun 3, 2024
6c496d2
Update code.html
ShayneGeo Jun 3, 2024
a3bacee
Update index.html
ShayneGeo Jun 3, 2024
041a5dd
Create code2.html
ShayneGeo Jun 3, 2024
05cb1e3
Update code2.html
ShayneGeo Jun 3, 2024
5b8d7e8
Update code2.html
ShayneGeo Jun 3, 2024
3cf1d44
Update code2.html
ShayneGeo Jun 3, 2024
bd22e48
Update code2.html
ShayneGeo Jun 3, 2024
58b4df2
Create code3.html
ShayneGeo Jun 3, 2024
634541a
Create codebuttons.html
ShayneGeo Jun 3, 2024
55c2ce1
Update index.html
ShayneGeo Jun 3, 2024
b18a1d4
Update codebuttons.html
ShayneGeo Jun 3, 2024
0fb3b05
Update code.html
ShayneGeo Jun 3, 2024
9e987a2
Update code2.html
ShayneGeo Jun 3, 2024
0eea231
Update code3.html
ShayneGeo Jun 3, 2024
e09a677
Update code2.html
ShayneGeo Jun 3, 2024
345a728
Update code.html
ShayneGeo Jun 3, 2024
95623be
Update code2.html
ShayneGeo Jun 3, 2024
bb71a1d
Update code2.html
ShayneGeo Jun 3, 2024
3fdc3b6
Create code4.html
ShayneGeo Jun 3, 2024
157b368
Update codebuttons.html
ShayneGeo Jun 3, 2024
39a0143
Update code3.html
ShayneGeo Jun 3, 2024
6cd0134
Update code2.html
ShayneGeo Jun 3, 2024
760222b
Update codebuttons.html
ShayneGeo Jun 3, 2024
792de91
Update code4.html
ShayneGeo Jun 3, 2024
46e8d86
Update code4.html
ShayneGeo Jun 3, 2024
ef3bba2
Update code4.html
ShayneGeo Jun 3, 2024
28336f8
Create code5.html
ShayneGeo Jun 3, 2024
bd3fb21
Update codebuttons.html
ShayneGeo Jun 3, 2024
a039da7
Update code4.html
ShayneGeo Jun 3, 2024
238ac33
Update code5.html
ShayneGeo Jun 3, 2024
1db77e4
Create weather.html
ShayneGeo Jun 3, 2024
d2663fd
Update code5.html
ShayneGeo Jun 3, 2024
e6467db
Update index.html
ShayneGeo Jun 3, 2024
cc36ab2
Update codebuttons.html
ShayneGeo Jun 3, 2024
8afbd3b
Update weather.html
ShayneGeo Jun 3, 2024
92ee17b
Update weather.html
ShayneGeo Jun 3, 2024
b22fe02
Update code5.html
ShayneGeo Jun 3, 2024
cbab62c
Update weather.html
ShayneGeo Jun 4, 2024
d4586f5
Update weather.html
ShayneGeo Jun 4, 2024
ab653ab
Update weather.html
ShayneGeo Jun 4, 2024
8887086
Create code6.html
ShayneGeo Jun 4, 2024
304f705
Update codebuttons.html
ShayneGeo Jun 4, 2024
a3b1b74
Update code6.html
ShayneGeo Jun 4, 2024
2c98211
Update code6.html
ShayneGeo Jun 4, 2024
e5e67a1
Update code6.html
ShayneGeo Jun 4, 2024
c5d1cd1
Update code6.html
ShayneGeo Jun 4, 2024
6dab5cb
Update code6.html
ShayneGeo Jun 4, 2024
53c7030
Update README.md
ShayneGeo Jun 4, 2024
43b9882
Update inter2.html
ShayneGeo Jun 4, 2024
70fb030
Update code6.html
ShayneGeo Jun 4, 2024
2535997
Update code4.html
ShayneGeo Jun 4, 2024
c8946fe
Update code6.html
ShayneGeo Jun 4, 2024
5b915a7
Update code6.html
ShayneGeo Jun 4, 2024
d53a5d5
Update proj4.html
ShayneGeo Jul 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added IMG_1730.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# ShayneGeo.github.io
Shayne Magstadt's Website

<a href="http://www.youtube.com/watch?feature=player_embedded&v=x6I4NZFgA5M
" target="_blank"><img src="http://img.youtube.com/vi/x6I4NZFgA5M/0.jpg"
alt="IMAGE ALT TEXT HERE" width="240" height="180" border="10" /></a>
112 changes: 112 additions & 0 deletions code.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Spirograph</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f2; /* Light earthy background */
color: #333;
margin: 0;
padding: 20px;
display: flex;
flex-direction: column;
align-items: center;
}
canvas {
border: 1px solid #333;
margin-top: 20px;
}
.controls {
display: flex;
flex-direction: column;
align-items: center;
}
.controls input, .controls select, .controls button {
margin: 5px;
}
.button {
display: inline-block;
padding: 10px 20px;
font-size: 16px;
color: #fff;
background-color: #ff6f61;
border: none;
border-radius: 5px;
text-decoration: none;
transition: background-color 0.3s ease;
margin-top: 20px; /* Ensure there's space above the button */
}
.button:hover {
background-color: #ff4940;
}
</style>
</head>
<body>
<h1>Spirograph</h1>
<div class="controls">
<label for="R">R (fixed circle radius):</label>
<input type="number" id="R" value="120">
<label for="r">r (moving circle radius):</label>
<input type="number" id="r" value="65">
<label for="O">O (offset):</label>
<input type="number" id="O" value="75">
<label for="chaos">Random Level:</label>
<input type="range" id="chaos" min="0" max="10" value="0" step="1">
<label for="mode">Mode:</label>
<select id="mode">
<option value="1">Mode 1</option>
<option value="2">Mode 2</option>
</select>
<button onclick="updateSpirograph()">Draw Spirograph</button>
</div>
<canvas id="spirographCanvas" width="400" height="400"></canvas>
<a href="codebuttons.html" class="button">Back to Codebutton</a>
<script>
function drawSpirograph(ctx, R, r, O, chaos, mode) {
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); // Clear the canvas
let x1 = R - O;
let y1 = 0;
let i = 0;
const steps = 20000; // Increase this number for a more detailed spirograph
ctx.beginPath();
ctx.moveTo(x1 + 200, y1 + 200);
for (i = 0; i <= steps; i++) {
let angle = i * Math.PI / 72;
let randomFactor = 1 + (Math.random() - 0.5) * chaos / 10;
let x2, y2;

if (mode === "1") {
x2 = randomFactor * ((R + r) * Math.cos(angle) - (r + O) * Math.cos(((R + r) / r) * angle));
y2 = randomFactor * ((R + r) * Math.sin(angle) - (r + O) * Math.sin(((R + r) / r) * angle));
} else if (mode === "2") {
// New equation for Mode 2
x2 = randomFactor * ((R + r) * Math.cos(angle) - (r + O) * Math.sin(((R + r) / r) * angle));
y2 = randomFactor * ((R + r) * Math.sin(angle) - (r + O) * Math.cos(((R + r) / r) * angle));
}

ctx.lineTo(x2 + 200, y2 + 200);
}
ctx.strokeStyle = '#2c5f2d';
ctx.stroke();
}

function updateSpirograph() {
const R = parseInt(document.getElementById('R').value);
const r = parseInt(document.getElementById('r').value);
const O = parseInt(document.getElementById('O').value);
const chaos = parseInt(document.getElementById('chaos').value);
const mode = document.getElementById('mode').value;
const canvas = document.getElementById('spirographCanvas');
const ctx = canvas.getContext('2d');
drawSpirograph(ctx, R, r, O, chaos, mode);
}

window.onload = function() {
updateSpirograph(); // Draw initial spirograph with default values
};
</script>
</body>
</html>
95 changes: 95 additions & 0 deletions code2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fractal Tree</title>
<style>
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #333;
color: #fff;
}
canvas {
border: 1px solid #fff;
margin-top: 20px;
}
.controls {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 20px; /* Move the input boxes down a bit */
}
.controls input, .controls label, .controls button {
margin: 5px;
}
.button {
display: inline-block;
padding: 10px 20px;
font-size: 16px;
color: #fff;
background-color: #ff6f61;
border: none;
border-radius: 5px;
text-decoration: none;
transition: background-color 0.3s ease;
margin-top: 20px; /* Ensure there's space above the button */
}
.button:hover {
background-color: #ff4940;
}
</style>
</head>
<body>
<div class="controls">
<label for="length">Initial Length:</label>
<input type="number" id="length" value="20">
<button onclick="updateFractalTree()">Draw Fractal Tree</button>
</div>
<canvas id="fractalTreeCanvas" width="400" height="400"></canvas>
<a href="codebuttons.html" class="button">Back to Codebutton</a>
<script>
function drawFractalTree(ctx, startX, startY, length, angle, branchWidth, color) {
ctx.beginPath();
ctx.save();
ctx.strokeStyle = color;
ctx.shadowBlur = 15;
ctx.shadowColor = 'rgba(0, 0, 0, 0.8)';
ctx.lineWidth = branchWidth;
ctx.translate(startX, startY);
ctx.rotate(angle * Math.PI / 180);
ctx.moveTo(0, 0);
ctx.lineTo(0, -length);
ctx.stroke();

if (length < 10) {
ctx.restore();
return;
}

drawFractalTree(ctx, 0, -length, length * 0.8, angle - 15, branchWidth, color);
drawFractalTree(ctx, 0, -length, length * 0.8, angle + 15, branchWidth, color);

ctx.restore();
}

function updateFractalTree() {
const length = parseInt(document.getElementById('length').value);
const color = '#ff0000'; // Red color
const canvas = document.getElementById('fractalTreeCanvas');
const ctx = canvas.getContext('2d');
ctx.clearRect(0, 0, canvas.width, canvas.height);
drawFractalTree(ctx, canvas.width / 2, canvas.height - 20, length, 0, 2, color);
}

window.onload = function() {
updateFractalTree(); // Draw initial fractal tree with default values
};
</script>
</body>
</html>
175 changes: 175 additions & 0 deletions code3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Agent-Based Modeling</title>
<style>
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #333;
color: #fff;
}
canvas {
border: 1px solid #fff;
margin-top: 20px;
}
.controls {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 20px;
}
.controls input, .controls label, .controls button, .controls a {
margin: 5px;
}
.button {
display: inline-block;
padding: 10px 20px;
font-size: 16px;
color: #fff;
background-color: #ff6f61;
border: none;
border-radius: 5px;
text-decoration: none;
transition: background-color 0.3s ease;
}
.button:hover {
background-color: #ff4940;
}
</style>
</head>
<body>
<h1>Agent-Based Modeling: Predator and Prey</h1>
<div class="controls">
<label for="numPrey">Number of Prey:</label>
<input type="number" id="numPrey" value="50">
<label for="numPredators">Number of Predators:</label>
<input type="number" id="numPredators" value="5">
<button onclick="setupSimulation()">Start Simulation</button>
<a href="codebuttons.html" class="button">Back to Codebutton</a>
</div>
<canvas id="abmCanvas" width="800" height="600"></canvas>
<script>
class Agent {
constructor(x, y, color) {
this.x = x;
this.y = y;
this.color = color;
this.size = 5;
}

distance(other) {
return Math.sqrt((this.x - other.x) ** 2 + (this.y - other.y) ** 2);
}

draw(ctx) {
ctx.fillStyle = this.color;
ctx.beginPath();
ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
ctx.fill();
}
}

class Prey extends Agent {
constructor(x, y) {
super(x, y, 'white');
}

move() {
this.x += (Math.random() - 0.5) * 10;
this.y += (Math.random() - 0.5) * 10;

// Ensure the prey stays within the canvas bounds
if (this.x < 0) this.x = 0;
if (this.x > 800) this.x = 800;
if (this.y < 0) this.y = 0;
if (this.y > 600) this.y = 600;
}
}

class Predator extends Agent {
constructor(x, y) {
super(x, y, 'red');
this.size = 8;
}

move(preyList) {
if (preyList.length === 0) return;

// Find the nearest prey
let nearestPrey = preyList[0];
let minDist = this.distance(nearestPrey);

for (const prey of preyList) {
const dist = this.distance(prey);
if (dist < minDist) {
minDist = dist;
nearestPrey = prey;
}
}

// Move towards the nearest prey
const angle = Math.atan2(nearestPrey.y - this.y, nearestPrey.x - this.x);
this.x += Math.cos(angle) * 5;
this.y += Math.sin(angle) * 5;

// Ensure the predator stays within the canvas bounds
if (this.x < 0) this.x = 0;
if (this.x > 800) this.x = 800;
if (this.y < 0) this.y = 0;
if (this.y > 600) this.y = 600;

// Check if the predator catches the prey
if (this.distance(nearestPrey) < this.size + nearestPrey.size) {
const index = preyList.indexOf(nearestPrey);
if (index > -1) {
preyList.splice(index, 1); // Remove the caught prey
}
}
}
}

function setupSimulation() {
const numPrey = parseInt(document.getElementById('numPrey').value);
const numPredators = parseInt(document.getElementById('numPredators').value);
const canvas = document.getElementById('abmCanvas');
const ctx = canvas.getContext('2d');

const preyList = [];
const predatorList = [];

for (let i = 0; i < numPrey; i++) {
preyList.push(new Prey(Math.random() * 800, Math.random() * 600));
}

for (let i = 0; i < numPredators; i++) {
predatorList.push(new Predator(Math.random() * 800, Math.random() * 600));
}

function update() {
ctx.clearRect(0, 0, canvas.width, canvas.height);

for (const prey of preyList) {
prey.move();
prey.draw(ctx);
}

for (const predator of predatorList) {
predator.move(preyList);
predator.draw(ctx);
}

requestAnimationFrame(update);
}

update();
}
</script>
</body>
</html>
Loading