Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// Create a list of dates to use as data points
// Count the amount of days since the creation date
int dayCount = DateTime.Now.Subtract(createdDate).Days;
// Create an index of data points and calculate linear interpolation for a given point
int[] membershipPoints = new int[dayCount];
for (int i = 0; i < membershipPoints.Length; i++)
// Calculate membership count using linear interpolation
membershipPoints[i] = (int)(((float)mg.members / ((float)membershipPoints.Length)) * (float)i);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment