chord-rect.js

total 0
used 0
limit 0
/* title: Chord Rect category: chords files: ../point_src/core/head.js ../point_src/pointpen.js ../point_src/pointdraw.js ../point_src/math.js ../point_src/extras.js ../point_src/point-content.js ../point_src/pointlist.js ../point_src/pointlistpen.js ../point_src/point.js ../point_src/stage.js mouse dragging stroke ../point_src/random.js ../point_src/chords.js --- */ class MainStage extends Stage { canvas = 'playspace' mounted(){ this.point = new Point({x: 250, y: 150 , radius: 20, rotation: 45}) this.topLeft = new Point({x: 20, y: 40 , radius: 10}) this.bottomRight = new Point({x: 500, y: 300 , radius: 10}) this.dragging.add(this.point, this.topLeft, this.bottomRight) } onMousedown(ev) { this.point.rotation = random.int(180) } draw(ctx){ this.clear(ctx) let p = this.point let tl = this.topLeft tl.pen.indicator(ctx) let br = this.bottomRight br.pen.indicator(ctx) let ps = rectChordEndpoints(this.topLeft, this.bottomRight, p)//, p.radians) ps = PointList.from(ps).cast() // let ps = rectChordEndpoints(20, 500, 40, 300, p[0], p[1], p.radians) ps.pen.fill(ctx, {color: 'purple'}) // ps.forEach(p=> (new Point(p)).pen.fill(ctx, {color: 'purple'})) ps[0]?.pen.line(ctx, ps[1], 'purple') this.point.pen.indicator(ctx) } } console.log('chord'); stage = MainStage.go(/*{ loop: true }*/)
Run
Meta Data
title Chord Rect
imports ()
files ('../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/pointdraw.js', '../point_src/math.js', '../point_src/extras.js', '../point_src/point-content.js', '../point_src/pointlist.js', '../point_src/pointlistpen.js', '../point_src/point.js', '../point_src/stage.js', 'mouse', 'dragging', 'stroke', '../point_src/random.js', '../point_src/chords.js')
unused_keys ()
unknown_keys ('category',)
category ['chords']
filepath_exists True
path chord-rect.js
filepath chord-rect.js
clean_files ('../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/pointdraw.js', '../point_src/math.js', '../point_src/extras.js', '../point_src/compass.js', '../point_src/center.js', '../point_src/point-content.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/pointlistpen.js', '../point_src/relative-xy.js', '../point_src/pointcast.js', '../point_src/point.js', '../point_src/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.js', '../point_src/events.js', '../point_src/automouse.js', '../point_src/functions/clamp.js', '../point_src/distances.js', '../point_src/protractor.js', '../point_src/text/beta.js', '../point_src/dragging.js', '../point_src/setunset.js', '../point_src/stroke.js', '../point_src/random.js', '../point_src/chords.js')
markdown {'html': '', 'content': 'title: Chord Rect\ncategory: chords\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/extras.js\n ../point_src/point-content.js\n ../point_src/pointlist.js\n ../point_src/pointlistpen.js\n ../point_src/point.js\n ../point_src/stage.js\n mouse\n dragging\n stroke\n ../point_src/random.js\n ../point_src/chords.js\n---'}