001package polaris.sdk.ui; 002/** One cubic Bezier quarter-corner. All lengths use logical UI units. */ 003public final class BezierCorner { 004 public final float radius, smoothing; 005 /** Smoothing 0 uses the usual cubic quarter-circle approximation; 1 has zero endpoint curvature. */ 006 public BezierCorner(float radius,float smoothing){ 007 if(!Float.isFinite(radius)||radius<0)throw new IllegalArgumentException("radius must be finite and >= 0"); 008 if(!Float.isFinite(smoothing)||smoothing<0||smoothing>1)throw new IllegalArgumentException("smoothing must be 0..1"); 009 this.radius=radius;this.smoothing=smoothing; 010 } 011 /** Cubic tangent handle length divided by radius. */ 012 public float handle(){return .55228475f+.44771525f*smoothing;} 013}