@@ -0,0 +1,1624 @@
+package com.haxademic.sketch.test;%0A%0Aimport com.haxademic.core.app.AppSettings;%0Aimport com.haxademic.core.app.P;%0Aimport com.haxademic.core.app.PAppletHax;%0Aimport com.haxademic.core.math.MathUtil;%0Aimport com.haxademic.core.math.easing.Penner;%0A%0Apublic class DistributionCurveTest%0Aextends PAppletHax %7B%0A%09public static void main(String args%5B%5D) %7B PAppletHax.main(Thread.currentThread().getStackTrace()%5B1%5D.getClassName()); %7D%0A%09%0A%09protected void overridePropsFile() %7B%0A%09%09p.appConfig.setProperty( AppSettings.WIDTH, 640 );%0A%09%09p.appConfig.setProperty( AppSettings.HEIGHT, 480 );%0A%09%09p.appConfig.setProperty( AppSettings.FULLSCREEN, false );%0A%09%09p.appConfig.setProperty( AppSettings.SMOOTHING, AppSettings.SMOOTH_HIGH );%0A%09%7D%0A%0A%09public void setup() %7B%0A%09%09super.setup();%0A%09%09background(0);%0A%09%7D%0A%09%0A%09public void drawApp() %7B%0A%09%09p.stroke(255);%0A%09%09for (int i = 0; i %3C 300; i++) %7B%0A%09%09%09float x = MathUtil.randRange(0, p.width);%0A%09%09%09float y = randomCurvedDistribution() * (float) p.height;%0A%09%09%09p.point(x, y);%0A%09%09%7D%0A%09%7D%0A%09%0A%09public float randomCurvedDistribution() %7B%0A%09%09/*%0A%09%09 * t: current time%0A%09%09 * b: start value%0A%09%09 * c: change in value%0A%09%09 * d: duration%0A%09%09 * http://easings.net/%0A%09%09 */%0A%09%09float equationPadding = 0.4f;%0A%09%09float easedPercent = Penner.easeInOutCirc(MathUtil.randRangeDecimal(equationPadding,1f-equationPadding), 0, 1, 1);%0A%09%09float minCurveVal = Penner.easeInOutCirc(equationPadding, 0, 1, 1);%0A%09%09easedPercent = P.map(easedPercent, minCurveVal, 1f - minCurveVal, 0f, 1f);%09// since we're starting on the penner curve, we need to remap from min/max values on that curve%0A%09%09easedPercent += 0.5f;%0A%09%09if(easedPercent %3E 1f) easedPercent -= 1f;%0A%09%09return easedPercent;%0A%09%7D%0A%7D%0A

Add distribution curve demo