public UniformMotionSprite( Surface surface, Point2 startLocation, Vector2F velocity, float totalTime) : this(new StaticAnimation(surface), startLocation, startLocation + (Vector2)(velocity * totalTime), totalTime) { }
public Vector2F Rotate90(Vector2F pivot) { return Add(-pivot) .Rotate90() .Add(pivot); }
/// <summary> /// 内積を求める。 /// </summary> /// <param name="v"> </param> /// <returns> </returns> public float InnerProduct(Vector2F v) { return X * v.X + Y * v.Y; }
public bool Equals(Vector2F v) { return v.X == X && v.Y == Y; }
/// <summary> /// 外積のZ成分(X, Y成分は0)を求める。 /// </summary> /// <param name="v"> </param> /// <returns> </returns> public float CrossProduct(Vector2F v) { return X * v.Y - Y * v.X; }
public Vector2F Add(Vector2F dv) { return new Vector2F(X + dv.X, Y + dv.Y); }
public UniformMotionSprite( AnimationSurface animationSurface, Point2 startLocation, Vector2F velocity, float totalTime) : this(animationSurface, startLocation, startLocation + (Vector2)(velocity * totalTime), totalTime) { }
public Point2F Rotate270(Vector2F pivot) { return Add(-pivot) .Rotate270() .Add(pivot); }
public Point2F Add(Vector2F dv) { return new Point2F(X + dv.X, Y + dv.Y); }