-
Notifications
You must be signed in to change notification settings - Fork 1
First Principles Official Documentation
First Principles is an interactive module where the user can freely tinker with different types of graphs and their derivatives, such as the three periodic functions, the quadratic parabola, the cubic function, the square root function, both logarithm, and natural logarithm graphs, etc. Feel free to make any contributions in the future major updates! We will be trying to keep everything up-to-date here as well.
First Principles uses the three-point method in order to numerically predict the instantaneous rate of change of the given function. All derivative graphs are affected by the transformations that have been made to the original function and are bound to a certain limit where the graph does not endlessly approach positive or negative infinity.
// Power of N Function
if (functionType == FunctionType.Power)
{
yValue = transA * (float)(Mathf.Pow(transK * (xValue - transD), power) + transC);
// Differentiate numerically using the centred three-point method
dyValue = ((transA * (float)(Mathf.Pow(transK * ((xValue + hValue) - transD), power) + transC)) - (transA * (float)(Mathf.Pow(transK * ((xValue - hValue) - transD), power) + transC))) / (hValue * 2);
}
// Exponential Function
else if (functionType == FunctionType.Exponential)
{
yValue = transA * (float)(Mathf.Pow(transK * baseN, (xValue - transD)) + transC);
// Differentiate numerically using the centred three-point method
dyValue = ((transA * (float)(Mathf.Pow(transK * baseN, ((xValue + hValue) - transD)) + transC)) - (transA * (float)(Mathf.Pow(transK * baseN, ((xValue - hValue) - transD)) + transC))) / (hValue * 2);
}
First Principles is a part of a not-for-profit and an open-source project College Math For Toddlers.
MIT License | Developed by Rayan Kaissi and John Seong.