Files
stgsharp/源代码/.Net/StgSharp/Geometries/Rectangle.cs
T

36 lines
719 B
C#

using StgSharp.Logic;
using System;
using System.Collections.Generic;
using System.Text;
namespace StgSharp.Geometries
{
public class Rectangle:IGeometryComplex
{
internal Point _vertex;
internal float _vecX1;
internal float _vecX2;
internal float _vecY1;
internal float _vecY2;
public Rectangle( Line side1, Line side2 )
{
_vecX1 = side1.VecX;
_vecX2 = side2.VecX;
_vecY1 = side1.VecY;
_vecY2 = side2.VecY;
if (_vecX1 * _vecX2 + _vecY1 * _vecY2 !=0 )
{
throw new ArgumentException("Given lines cannot form a rectangle!");
}
}
}
}