[ad_1]
Chapter: 3
Official book website:
Twitter:
added annotations
This video describes the basics of trigonometry and how to use polar coordinates in Processing.
Read along:
Help us caption & translate this video!
[ad_1]
Chapter: 3
Official book website:
Twitter:
added annotations
This video describes the basics of trigonometry and how to use polar coordinates in Processing.
Read along:
Help us caption & translate this video!
by
Tags:
my maths teacher always told us an easy way of remembering SOHCAHTOA.
SEX=SIN
ON=OPPOSITE
HARD=HYPOTENUSE
CONCRETE=COS
ALWAYS=ADJACENT
HURTS=HYPOTENUSE
THE=TAN
OUTER=OPPOSITE
ARMS=ADJACENT
Always stuck with my that has. haha
So I understand what you are saying here, but how does one calculate the angle into a usable format. As it stands I've been using Cartesian coordinates to do all of my angle calculations in what seems like a primitive manner. I've been on Khan academy which doesn't have full access to the PVector function, Vector math doesn't work. So I take my origin (player) x,y as x1 and y1, and the mouse as x2, y2 and calculate angle with slope using m = y2-y1 over x2 – x1, then I can create a trajectory as y += m.y and x += m.x respectively. However after watching this I'm interested how I can convert to cos(o) sin(o) using angles if I don't know the angle. While I feel like the answer is staring me in the face, I don't know it. the rise over run doesn't give me the angle that I'm aware of, only a magnitude of the distance for individual x's and y's per iteration of frame. So how to get the angle??
Just a quick note if you are learning this stuff but using P5.JS. PI will not work outside setup, here's a thread about it (https://github.com/processing/p5.js/issues/903). Not really sure of solid alternative, I just wrote 3.14 as the actual value instead.
//mapping the "yo-yo" with peril noise, for anyone who's stuck!
float y;
float x;
float r = 100;
float a = 0.0;
float t = 0;
void setup() {
size(600, 600);
}
void draw() {
background(255);
translate(width/2, height/2);
y = r*sin(a);
x = r*cos(a);
fill(0);
line(0, 0, x, y);
ellipse(x, y, 50, 50);
a+= 0.1;
float n = noise(t);
r = map(n, 0, 1, 0, 200);
t+= 0.01;
}
thanks great!
You are awesome!!!! And btw your constant reminder of perlin noise made me master it rapidly 😀
Thanks for everything!!!
I'm not somebody who has been very good at math in the past, but I've learned more about math in this video than in my entire four years of high school. You have a way of explaining things that is easy to follow and just makes a lot of sense to the point where I'm actually interested in a subject that used to intimidate me. Nice job!
Great tutorial
You are succeeding where my high school math teachers failed, I'm actually beginning to understand trigonometry and its real world applications, this is awesome!
Thank.You.
Leave a Reply