Source code for Musica.Geometry.Rectangle

####################################################################################################
#
# Musica - A Music Theory Package for Python
# Copyright (C) 2017 Fabrice Salvaire
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
####################################################################################################

####################################################################################################

from .Primitive import Primitive2D
from .Vector import Vector2D

####################################################################################################

[docs]class Rectangle(Primitive2D): #######################################
[docs] def __init__(self, p0, p1): """ Construct a :class:`Rectangle` between two points. """ self._p0 = Vector2D(p0) self._p1 = Vector2D(p1)
##############################################
[docs] def clone(self): return self.__class__(self._p0, self._p1)
############################################## @property def p0(self): return self._p0 @p0.setter def p0(self, value): self._p0 = value @property def p1(self): return self._p1 @p1.setter def p1(self, value): self._p1 = value