UniKerogen / TempleECE3712

Intro to EMF with Dr.Silage Matlab Code
MIT License
0 stars 0 forks source link

Project 1 Theory 2 Compiled: Month Can Be > Date #5

Closed b-macdonald closed 7 years ago

b-macdonald commented 7 years ago

If you want to make the code workable for other dates of birth, add a little comparison field to check if month > date. If so, some of the X and Z distances have to be changed.

b-macdonald commented 7 years ago

Here's my method:

clear; clf; clc;

birthdate = 26;
birthmonth = 5;
birthyear = 1997;

if birthdate > birthmonth
    X1 = birthmonth;
    Z1 = birthdate;
    Y1 = (X1 + Z1) / 2;
else
    X1 = birthdate;
    Z1 = birthmonth;
    Y1 = (X1 + Z1) / 2;
end

theta = (birthyear - 1985) * 2;
theta = degtorad(theta);
UniKerogen commented 7 years ago

Thank you, I will implement this into the code.

UniKerogen commented 7 years ago

Updated the file of Compiled 2. Thank you.