mitre-line.js

total 0
used 0
limit 0
/* categories: lines files: ../point_src/core/head.js ../point_src/pointpen.js ../point_src/pointdraw.js ../point_src/math.js ../point_src/point-content.js ../point_src/pointlistpen.js ../point_src/pointlist.js ../point_src/point.js ../point_src/text/beta.js mouse ../point_src/random.js dragging stage stroke ../point_src/split.js ../point_src/bisector.js ../point_src/angle.js */ class MainStage extends Stage { canvas = 'playspace' mounted(){ // this.point = this.center.copy().update({radius: 100}) this.points = new PointList( [233, 325, 20] , [189, 169, 30] // , [442, 113, 30] // , [626, 215, 70] // , [525, 419, 20] ).cast() this.dragging.add(...this.points) } draw(ctx){ this.clear(ctx) ctx.strokeStyle = '#444' this.points.pen.circle(ctx) ctx.strokeStyle = '#880000' let a = this.points[0] let b = this.points[1] let deg = radiansToDegrees(a.directionTo(b)) a.rotation = quantizeAngle(deg, 4) deg = radiansToDegrees(b.directionTo(a)) b.rotation = quantizeAngle(deg, 4) // a.rotation = 0 // b.rotation = -180 /* Draw a line from center, to the projected tip (radius)*/ let aTip = a.project() a.pen.line(ctx, aTip) /* Draw a line from center, to the projected tip (radius) Other Line.*/ let bTip = b.project() bTip.pen.line(ctx, b) /* Draw the line between the two target points.*/ aTip.pen.line(ctx, bTip) } } stage = MainStage.go(/*{ loop: true }*/)
Run
Meta Data
imports ()
files ('../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/pointdraw.js', '../point_src/math.js', '../point_src/point-content.js', '../point_src/pointlistpen.js', '../point_src/pointlist.js', '../point_src/point.js', '../point_src/text/beta.js', 'mouse', '../point_src/random.js', 'dragging', 'stage', 'stroke', '../point_src/split.js', '../point_src/bisector.js', '../point_src/angle.js')
unused_keys ('title',)
unknown_keys ('categories',)
categories ['lines']
filepath_exists True
path mitre-line.js
filepath mitre-line.js
clean_files ('../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/pointdraw.js', '../point_src/math.js', '../point_src/compass.js', '../point_src/center.js', '../point_src/point-content.js', '../point_src/pointlistpen.js', '../point_src/pointlistdraw.js', '../point_src/pointlistgradient.js', '../point_src/pointlistshape.js', '../point_src/pointlistgenerator.js', '../point_src/unpack.js', '../point_src/pointlist.js', '../point_src/relative-xy.js', '../point_src/pointcast.js', '../point_src/point.js', '../point_src/text/beta.js', '../point_src/events.js', '../point_src/automouse.js', '../point_src/random.js', '../point_src/functions/clamp.js', '../point_src/distances.js', '../point_src/protractor.js', '../point_src/dragging.js', '../point_src/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.js', '../point_src/setunset.js', '../point_src/stroke.js', '../point_src/split.js', '../point_src/bisector.js', '../point_src/angle.js')
markdown {'html': '', 'content': 'categories: lines\nfiles:\n ../point_src/core/head.js\n ../point_src/pointpen.js\n ../point_src/pointdraw.js\n ../point_src/math.js\n ../point_src/point-content.js\n ../point_src/pointlistpen.js\n ../point_src/pointlist.js\n ../point_src/point.js\n ../point_src/text/beta.js\n mouse\n ../point_src/random.js\n dragging\n stage\n stroke\n ../point_src/split.js\n ../point_src/bisector.js\n ../point_src/angle.js'}