import { Traceable } from "." ; import { Point2D , Vector2D } from "../types/sol" ; import { v } from ".." ; import SimplePath from "./SimplePath" ; export default class Line implements Traceable { constructor ( private a , private b ) { } param delta moved ( delta ) { return new Line ( v . add ( this . a , delta ) , v . add ( this . b , delta ) ) ; } traceIn = ( ctx ) => { ctx . moveTo ( ... this . a ) ; ctx . lineTo ( ... this . b ) ; } ; get path ( ) : SimplePath { return new SimplePath ( [ this . a , this . b ] ) ; } }