public static unsafe void GetRgssOffsets (PointD* samplesArray, int sampleCount, int quality) { if (sampleCount < 1) throw new ArgumentOutOfRangeException ("sampleCount", "sampleCount must be [0, int.MaxValue]"); if (sampleCount != quality * quality) throw new ArgumentOutOfRangeException ("sampleCount != (quality * quality)"); if (sampleCount == 1) { samplesArray[0] = new PointD (0.0, 0.0); } else { for (int i = 0; i < sampleCount; ++i) { double y = (i + 1d) / (sampleCount + 1d); double x = y * quality; x -= (int)x; samplesArray[i] = new PointD (x - 0.5d, y - 0.5d); } } }
public PointD UnscalePointJustY (PointD p) { return new PointD (p.X, UnscaleScalar (p.Y)); }
public static PointD Lerp (PointD from, PointD to, float frac) { return new PointD (Lerp (from.X, to.X, frac), Lerp (from.Y, to.Y, frac)); }
public PointD UnscalePointJustX (PointD p) { return new PointD (UnscaleScalar (p.X), p.Y); }
public PointD UnscalePoint (PointD p) { return new PointD (UnscaleScalar (p.X), UnscaleScalar (p.Y)); }
public PointD ScalePoint (PointD p) { return new PointD (ScaleScalar (p.X), ScaleScalar (p.Y)); }
public static Cairo.PointD ToCairoPointD(this PointD point) { return(new Cairo.PointD(point.X, point.Y)); }
public double Distance (PointD e) { return new PointD (X - e.X, Y - e.Y).Magnitude (); }