A Journey back in time..
In 2013 a game was released that in the following year would take the world by storm. A young Vietnamese programmer named Dong Nguyen released a game that he would later remove from the App store from guilt of overuse and the addictive nature of the game. That game was Fla...
So what is a force?
A vector that causes an object with mass to accelerate.
All objects with mass experience force. Some common forces: gravity, tension, spring, buoyancy, air resistance.
These are things we want to model within our code to create a dynamic simulation of the real wor...
This year has really got off to a flying start. I'm super busy at work and school and I have been squeezing in non work related learning when I can. I have had to do more database work at my day job so I have been wrapping my head around that which has stunted my progress with the Nature of Code.
As expected my schedule is only getting busier, however I have been squeezing in some learning on my lunch breaks. I learnt a little more about vectors and vector math this week so I'm sharing my notes.
Last post I looked at add a vectors together to vectors, let's remind ourselves how that works...
What is a vector?
In the Euclidean sense a vector is something that has magnitude and direction.
The size of the vector is the magnitude and the direction is the angle in relation to an x axis running adjacent to the vector.
A vector doesn't necessarily have to be expressed as a magnitude and...
Making the random numbers seem more organic.
But there is another mathematical tool that we have at our disposal to make some nice sets of numbers. Enter:
Perlin Noise allows us to make smooth randomness, It was originally developed to create textures in 3d graphics. Let's say we...
Last time I looked at how Normal Distrobution can make make random numbers consistently closer to the mean.
Let's customize the distribution a little.
Back to cacti, say we wanted to model a mature group of cacti that are all very tall.
We might create a function like this:
We would just p...
In post one I looked a random walker, a small dot that moved across the screen based on a number between 0 - 3.
Although It worked, It didn't move in a way that seemed natural. It was, well, too random.
Wouldn't it be great to generate sets of numbers that seem more naturally distributed.
I'm going the explore the things to consider when planning a new project.
Make a Decision
As a web application developer I make a lot of decisions each day. The art of programming is making decisions ahead of time and writing the code to deal with the potential decisions the program sh...
What is Probability?
Probability is the measure of the likelihood that an event will occur. It is a way to evaluate a given set of scenarios and decide how often will event x happen.
Lets look at an example in code:
See the Pen Random Walker by Adam Harpur (@harps116) on C...