public EffectCircle(float origin_x, float origin_y, float radius = 1.0f) { origin = new EffectPoint(origin_x, origin_y); this.radius = radius; SetDefaultBounds(); }
public EffectCircle(EffectPoint origin, float radius = 1.0f) { this.origin = origin; this.radius = radius; SetDefaultBounds(); }
public bool Equals(EffectPoint p) { if ((object)p == null) { return(false); } return((X == p.X) && (Y == p.Y)); }
public EffectPoint GetPoint(float t) { EffectPoint ret = new EffectPoint(radius * (float)Math.Cos(t) + origin.X, radius * (float)Math.Sin(t) + origin.Y); if (ret.X < this.x_low_bound || ret.X > this.x_high_bound) { ret.X = float.NaN; } if (ret.Y < this.y_low_bound || ret.Y > this.y_high_bound) { ret.Y = float.NaN; } return(ret); }
public override bool Equals(System.Object obj) { if (obj == null) { return(false); } EffectPoint p = obj as EffectPoint; if ((System.Object)p == null) { return(false); } // Return true if the fields match: return((X == p.X) && (Y == p.Y)); }
public EffectLine(EffectPoint start, EffectPoint end, bool isBoundedByPoints = false) { if ((end.X - start.X) <= 0.1f && (end.X - start.X) >= -0.1f) { this.slope = float.NaN; this.y_offset = start.X + start.Y; } else { this.slope = (end.Y - start.Y) / (end.X - start.X); this.y_offset = (-this.slope * start.X) + start.Y; } if (isBoundedByPoints) { if (start.X < end.X) { SetXBounds(start.X, end.X); } else { SetXBounds(end.X, start.X); } if (start.Y < end.Y) { SetYBounds(start.Y, end.Y); } else { SetYBounds(end.Y, start.Y); } } else { SetDefaultBounds(); } }
public EffectPoint GetPoint(float x) { EffectPoint ret; if (float.IsNaN(slope)) { ret = new EffectPoint(y_offset, x); } else { ret = new EffectPoint(x, slope * x + y_offset); } if (ret.X < this.x_low_bound || ret.X > this.x_high_bound) { ret.X = float.NaN; } if (ret.Y < this.y_low_bound || ret.Y > this.y_high_bound) { ret.Y = float.NaN; } return(ret); }
public EffectPoint(EffectPoint otherPoint) { X = otherPoint.X; Y = otherPoint.Y; }