import { Vector } from './vector' ; import { ILine } from '../../interfaces' ; /**
 * Creates a line vector
 */ export class Line extends Vector < Line , ILine > { param point1 param point2 constructor ( point1 , point2 ) { super ( 'line' ) ; this . setPoint1 ( point1 ) ; this . setPoint2 ( point2 ) ; } param point private setPoint1 ( point ) { if ( Array . isArray ( point ) ) { this . content . x1 = point [ 0 ] ; this . content . y1 = point [ 1 ] ; } else { this . content . x1 = point ; this . content . y1 = point ; } } param point private setPoint2 ( point ) { if ( Array . isArray ( point ) ) { this . content . x2 = point [ 0 ] ; this . content . y2 = point [ 1 ] ; } else { this . content . x2 = point ; this . content . y2 = point ; } } }