two-point-chord-example.js

total 0
used 0
limit 0
/* title: Two Point Circle Segment category: chords files: head ../point_src/extras.js pointlist point stage mouse dragging stroke ../point_src/random.js ../point_src/chords.js --- A _segment_, is a non-equidistant chord. !here the points are _anywhere_ around the edge. In this example the the two points project a chord within the area point. */ class MainStage extends Stage { canvas = 'playspace' mounted(){ this.areaPoint = new Point({x: 250, y: 150 , radius: 100}) this.iPoint = new Point({x: 250, y: 150 , radius: 10, rotation: 0}) this.iPoint2 = new Point({x: 350, y: 150 , radius: 10, rotation: 0}) this.dragging.add(this.areaPoint, this.iPoint, this.iPoint2) } draw(ctx){ this.clear(ctx) let p = this.areaPoint let chord = this.iPoint let chord2 = this.iPoint2 chord.pen.indicator(ctx) chord2.pen.indicator(ctx) let r = chordEndpoints2(p, chord, chord2) p.pen.circle(ctx, undefined, 'purple') if(r) { new Point(r[0]).pen.line(ctx, r[1], 'green') r.forEach(d=>{ new Point(d).pen.fill(ctx, 'purple') }); } } } stage = MainStage.go(/*{ loop: true }*/)
Run
Meta Data
title Two Point Circle Segment
imports ()
files ('head', '../point_src/extras.js', 'pointlist', 'point', 'stage', 'mouse', 'dragging', 'stroke', '../point_src/random.js', '../point_src/chords.js')
unused_keys ()
unknown_keys ('category',)
category ['chords']
filepath_exists True
path two-point-chord-example.js
filepath two-point-chord-example.js
clean_files ('../point_src/core/head.js', '../point_src/extras.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/pointpen.js', '../point_src/compass.js', '../point_src/center.js', '../point_src/point-content.js', '../point_src/pointdraw.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': '<p>A <em>segment</em>, is a non-equidistant chord. !here the points are <em>anywhere</em> around the edge.</p>\n<p>In this example the the two points project a chord within the area point.</p>', 'content': 'title: Two Point Circle Segment\ncategory: chords\nfiles:\n head\n ../point_src/extras.js\n pointlist\n point\n stage\n mouse\n dragging\n stroke\n ../point_src/random.js\n ../point_src/chords.js\n---\n\nA _segment_, is a non-equidistant chord. !here the points are _anywhere_ around the edge.\n\nIn this example the the two points project a chord within the area point.'}