0x440e…5397

All memos sent from and to 0x440e…5397.

let mintNumber=parseInt(tokenData.tokenId)%1e6;var DEFAULT_SIZE=900,WIDTH=window.innerWidth,HEIGHT=window.innerHeight,DIM=Math.min(WIDTH,HEIGHT),M=DIM/DEFAULT_SIZE,WIDTH=600,HEIGHT=900;let R=new Random,ORIGIN_VECTOR,DIMENSIONS_VECTOR,TRAITS={},colourScheme,minorRoads=[],majorRoads=[],mainRoads=[],highlightRoads=[],mainRoadsGenerator,majorRoadsGenerator,minorRoadsGenerator,highlightRoadsGenerator,mainParams,majorParams,minorParams={dsep:20,dtest:15,dstep:1,dlookahead:40,dcirclejoin:5,joinangle:.1,pathIterations:1e3,seedTries:300,simplifyTolerance:.5,collideEarly:0,pathIterations:1.5*Math.max(WIDTH,HEIGHT)},TENSOR_SPAWN_SCALE=.7,basisFields=[];function sampleFieldVector(e,o){e=samplePoint(e);return o?e.getMajor():e.getMinor()}function integrate(e,o){var a=sampleFieldVector(e,o),t=sampleFieldVector(e.copy().add(createVector(minorParams.dstep/2,minorParams.dstep/2)),o),e=sampleFieldVector(e.copy().add(createVector(minorParams.dstep,minorParams.dstep)),o);return a.add(t.mult(4)).add(e).mult(minorParams.dstep/6)}function addGrid(e,o,a,t){e=new BasisField(e,o,a,t,0);basisFields.push(e)}function addRadial(e,o,a){e=new BasisField(e,o,a,1);basisFields.push(e)}function samplePoint(o){const a=Tensor.zero;return basisFields.forEach(e=>a.add(e.getWeightedTensor(o))),a}function setRecommended(){var e=createVector(WIDTH,HEIGHT),o=e.mult(TENSOR_SPAWN_SCALE),e=e.mult((1-TENSOR_SPAWN_SCALE)/2),a=(this.addGridAtLocation(e),this.addGridAtLocation(e.copy().add(o)),this.addGridAtLocation(e.copy().add(createVector(o.x,0))),this.addGridAtLocation(e.copy().add(createVector(0,o.y))),R.random_num(0,3));for(let e=0;e<a;e++)addRadialRandom()}function addRadialRandom(){var e=createVector(WIDTH,HEIGHT),o=e.x,e=e.y,a=randomLocation();a.x=R.random_num(0,o),a.y=R.random_num(0,e),addRadial(a,R.random_num(o/8,o/2),R.random_num(0,5))}function addGridAtLocation(e){addGrid(e,R.random_num(0,1600),R.random_num(0,50),R.random_num(0,Math.PI/2))}function randomLocation(){var e=createVector(WIDTH,HEIGHT),o=e.mult(TENSOR_SPAWN_SCALE),o=createVector(R.random_dec(),R.random_dec()).mult(o).mult(5),e=e.mult((1-TENSOR_SPAWN_SCALE)/2);return o.add(e)}function backFillColors(e){(colourScheme=e).outlineSize=2,colourScheme.minorWidth=3,colourScheme.majorWidth=6,colourScheme.mainWidth=7.5,colourScheme.mainWidth=7.5}function distanceToSquared(e,o){var a=o.x-e.x,o=o.y-e.y;return a*a+o*o}async function setup(){createCanvas(WIDTH*M,HEIGHT*M),ORIGIN_VECTOR=createVector(0,0),DIMENSIONS_VECTOR=createVector(WIDTH,HEIGHT),TRAITS.colorTheme=R.random_choice(C),backFillColors(TRAITS.colorTheme),TRAITS.distance=Math.floor(100*R.random_num(.1*(mintNumber+1),.2*(mintNumber+1)))/100,TRAITS.pace=600-30*R.random_num(.1*(mintNumber+1),.2*(mintNumber+1)),TRAITS.time=TRAITS.pace*TRAITS.distance,TRAITS.elevationGain=Math.floor(R.random_num(0,1e3)),TRAITS.maxElevation=Math.floor(R.random_num(0,1e3)),TRAITS.restDay=R.random_bool(.14),TRAITS.restDay&&(delete TRAITS.distance,delete TRAITS.pace,delete TRAITS.time,delete TRAITS.elevationGain,delete TRAITS.maxElevation),setRecommended(),(majorParams=Object.assign({},minorParams)).dsep=100,majorParams.dtest=30,majorParams.dlookahead=200,majorParams.collideEarly=0,majorParams.pathIterations=1.5*Math.max(WIDTH,HEIGHT)/majorParams.dstep,(mainParams=Object.assign({},minorParams)).dsep=400,mainParams.dtest=200,mainParams.dlookahead=500,mainParams.collideEarly=0,mainParams.pathIterations=1.5*Math.max(WIDTH,HEIGHT)/mainParams.dstep,mainRoadsGenerator=new RoadGenerator(mainParams),majorRoadsGenerator=new RoadGenerator(majorParams),minorRoadsGenerator=new RoadGenerator(minorParams),highlightRoadsGenerator=new RoadGenerator(minorParams),await mainRoadsGenerator.generateRoads(),await majorRoadsGenerator.generateRoads(),await minorRoadsGenerator.generateRoads(),await highlightRoadsGenerator.generateRoads(),minorRoads=minorRoadsGenerator.roads,majorRoads=majorRoadsGenerator.roads,mainRoads=mainRoadsGenerator.roads,highlightRoads=highlightRoadsGenerator.roads,background(colourScheme.bgColour),stroke(colourScheme.minorRoadOutline),strokeWeight(colourScheme.outlineSize*M+colourScheme.minorWidth*M);for(const o of minorRoads)for(let e=0;e<o.length-1;e++)line(o[e].x*M,o[e].y*M,o[e+1].x*M,o[e+1].y*M);stroke(colourScheme.majorRoadOutline),strokeWeight(colourScheme.outlineSize*M+colourScheme.majorWidth*M);for(const a of majorRoads)for(let e=0;e<a.length-1;e++)line(a[e].x*M,a[e].y*M,a[e+1].x*M,a[e+1].y*M);stroke(colourScheme.mainRoadOutline),strokeWeight(colourScheme.outlineSize*M+colourScheme.mainWidth*M);for(const r of mainRoads)for(let e=0;e<r.length-1;e++)line(r[e].x*M,r[e].y*M,r[e+1].x*M,r[e+1].y*M);stroke(colourScheme.minorRoadColour),strokeWeight(colourScheme.minorWidth*M);for(const i of minorRoads)for(let e=0;e<i.length-1;e++)line(i[e].x*M,i[e].y*M,i[e+1].x*M,i[e+1].y*M);stroke(colourScheme.majorRoadColour),strokeWeight(colourScheme.majorWidth*M);for(const n of majorRoads)for(let e=0;e<n.length-1;e++)line(n[e].x*M,n[e].y*M,n[e+1].x*M,n[e+1].y*M);stroke(colourScheme.mainRoadColour),strokeWeight(colourScheme.mainWidth*M);for(const m of mainRoads)for(let e=0;e<m.length-1;e++)line(m[e].x*M,m[e].y*M,m[e+1].x*M,m[e+1].y*M);if(rectMode(CENTER),noFill(),strokeWeight(45*M),stroke(colourScheme.highlight),rect(WIDTH*M/2,HEIGHT*M/2,WIDTH*M,HEIGHT*M,50*M),strokeWeight(5*M),TRAITS.restDay)textAlign(CENTER,CENTER),fill(colourScheme.highlight),stroke(colourScheme.highlight),textSize(200*M),strokeWeight(20*M),text("REST",WIDTH*M*.5,HEIGHT*M*(1/3)),text("DAY",WIDTH*M*.5,HEIGHT*M*(2/3));else{fill(colourScheme.bgColour),rect(WIDTH*M/2,HEIGHT*M*.828125,WIDTH*M*.5,HEIGHT*M/4,30*M),stroke(colourScheme.highlight),fill(colourScheme.highlight),strokeWeight(1.5*M),textAlign(CENTER),textSize(15*M),text("Distance:",WIDTH*M*.375,HEIGHT*M*.75),text("Moving Time:",WIDTH*M*.375,HEIGHT*M*.8125),text("Max Elevation:",WIDTH*M*.375,HEIGHT*M*.875),text("Avg Pace",WIDTH*M*.625,HEIGHT*M*.75),text("Elevation Gain",WIDTH*M*.625,HEIGHT*M*.8125),textSize(18*M),text(TRAITS.distance+" mi",WIDTH*M*.375,HEIGHT*M*(25/32));var t=Math.floor(TRAITS.time/3600);let e=Math.floor((TRAITS.time-3600*t)/60),o=Math.floor(TRAITS.time-3600*t-60*e);e<10&&(e="0"+e),o<10&&(o="0"+o),text(`${t}:${e}:`+o,WIDTH*M*.375,HEIGHT*M*(27/32)),text(TRAITS.maxElevation+" ft",WIDTH*M*.375,HEIGHT*M*(29/32));t=Math.floor(TRAITS.pace/60);let a=Math.floor(TRAITS.pace-60*t);a<10&&(a="0"+a),text(`${t}:${a} / mi`,WIDTH*M*.625,HEIGHT*M*(25/32)),text(TRAITS.elevationGain+" ft",WIDTH*M*.625,HEIGHT*M*(27/32))}}
let mintNumber=parseInt(tokenData.tokenId)%1e6;var DEFAULT_SIZE=1200,WIDTH=window.innerWidth,HEIGHT=window.innerHeight,DIM=Math.min(WIDTH,HEIGHT),M=DIM/DEFAULT_SIZE,WIDTH=600,HEIGHT=900;let R=new Random,ORIGIN_VECTOR,DIMENSIONS_VECTOR,TRAITS={},colourScheme,minorRoads=[],majorRoads=[],mainRoads=[],highlightRoads=[],mainRoadsGenerator,majorRoadsGenerator,minorRoadsGenerator,highlightRoadsGenerator,mainParams,majorParams,minorParams={dsep:20,dtest:15,dstep:1,dlookahead:40,dcirclejoin:5,joinangle:.1,pathIterations:1e3,seedTries:300,simplifyTolerance:.5,collideEarly:0,pathIterations:1.5*Math.max(WIDTH,HEIGHT)},TENSOR_SPAWN_SCALE=.7,basisFields=[];function sampleFieldVector(e,o){e=samplePoint(e);return o?e.getMajor():e.getMinor()}function integrate(e,o){var a=sampleFieldVector(e,o),t=sampleFieldVector(e.copy().add(createVector(minorParams.dstep/2,minorParams.dstep/2)),o),e=sampleFieldVector(e.copy().add(createVector(minorParams.dstep,minorParams.dstep)),o);return a.add(t.mult(4)).add(e).mult(minorParams.dstep/6)}function addGrid(e,o,a,t){e=new BasisField(e,o,a,t,0);basisFields.push(e)}function addRadial(e,o,a){e=new BasisField(e,o,a,1);basisFields.push(e)}function samplePoint(o){const a=Tensor.zero;return basisFields.forEach(e=>a.add(e.getWeightedTensor(o))),a}function setRecommended(){var e=createVector(WIDTH,HEIGHT),o=e.mult(TENSOR_SPAWN_SCALE),e=e.mult((1-TENSOR_SPAWN_SCALE)/2),a=(this.addGridAtLocation(e),this.addGridAtLocation(e.copy().add(o)),this.addGridAtLocation(e.copy().add(createVector(o.x,0))),this.addGridAtLocation(e.copy().add(createVector(0,o.y))),R.random_num(0,3));for(let e=0;e<a;e++)addRadialRandom()}function addRadialRandom(){var e=createVector(WIDTH,HEIGHT),o=e.x,e=e.y,a=randomLocation();a.x=R.random_num(0,o),a.y=R.random_num(0,e),addRadial(a,R.random_num(o/8,o/2),R.random_num(0,5))}function addGridAtLocation(e){addGrid(e,R.random_num(0,1600),R.random_num(0,50),R.random_num(0,Math.PI/2))}function randomLocation(){var e=createVector(WIDTH,HEIGHT),o=e.mult(TENSOR_SPAWN_SCALE),o=createVector(R.random_dec(),R.random_dec()).mult(o).mult(5),e=e.mult((1-TENSOR_SPAWN_SCALE)/2);return o.add(e)}function backFillColors(e){(colourScheme=e).outlineSize=2,colourScheme.minorWidth=3,colourScheme.majorWidth=6,colourScheme.mainWidth=7.5,colourScheme.mainWidth=7.5}function distanceToSquared(e,o){var a=o.x-e.x,o=o.y-e.y;return a*a+o*o}async function setup(){createCanvas(WIDTH*M,HEIGHT*M),ORIGIN_VECTOR=createVector(0,0),DIMENSIONS_VECTOR=createVector(WIDTH,HEIGHT),TRAITS.colorTheme=R.random_choice(C),backFillColors(TRAITS.colorTheme),TRAITS.distance=Math.floor(100*R.random_num(.1*(mintNumber+1),.2*(mintNumber+1)))/100,TRAITS.pace=600-30*R.random_num(.1*(mintNumber+1),.2*(mintNumber+1)),TRAITS.time=TRAITS.pace*TRAITS.distance,TRAITS.elevationGain=Math.floor(R.random_num(0,1e3)),TRAITS.maxElevation=Math.floor(R.random_num(0,1e3)),TRAITS.restDay=R.random_bool(.14),TRAITS.restDay&&(delete TRAITS.distance,delete TRAITS.pace,delete TRAITS.time,delete TRAITS.elevationGain,delete TRAITS.maxElevation),setRecommended(),(majorParams=Object.assign({},minorParams)).dsep=100,majorParams.dtest=30,majorParams.dlookahead=200,majorParams.collideEarly=0,majorParams.pathIterations=1.5*Math.max(WIDTH,HEIGHT)/majorParams.dstep,(mainParams=Object.assign({},minorParams)).dsep=400,mainParams.dtest=200,mainParams.dlookahead=500,mainParams.collideEarly=0,mainParams.pathIterations=1.5*Math.max(WIDTH,HEIGHT)/mainParams.dstep,mainRoadsGenerator=new RoadGenerator(mainParams),majorRoadsGenerator=new RoadGenerator(majorParams),minorRoadsGenerator=new RoadGenerator(minorParams),highlightRoadsGenerator=new RoadGenerator(minorParams),await mainRoadsGenerator.generateRoads(),await majorRoadsGenerator.generateRoads(),await minorRoadsGenerator.generateRoads(),await highlightRoadsGenerator.generateRoads(),minorRoads=minorRoadsGenerator.roads,majorRoads=majorRoadsGenerator.roads,mainRoads=mainRoadsGenerator.roads,highlightRoads=highlightRoadsGenerator.roads,background(colourScheme.bgColour),stroke(colourScheme.minorRoadOutline),strokeWeight(colourScheme.outlineSize*M+colourScheme.minorWidth*M);for(const o of minorRoads)for(let e=0;e<o.length-1;e++)line(o[e].x*M,o[e].y*M,o[e+1].x*M,o[e+1].y*M);stroke(colourScheme.majorRoadOutline),strokeWeight(colourScheme.outlineSize*M+colourScheme.majorWidth*M);for(const a of majorRoads)for(let e=0;e<a.length-1;e++)line(a[e].x*M,a[e].y*M,a[e+1].x*M,a[e+1].y*M);stroke(colourScheme.mainRoadOutline),strokeWeight(colourScheme.outlineSize*M+colourScheme.mainWidth*M);for(const r of mainRoads)for(let e=0;e<r.length-1;e++)line(r[e].x*M,r[e].y*M,r[e+1].x*M,r[e+1].y*M);stroke(colourScheme.minorRoadColour),strokeWeight(colourScheme.minorWidth*M);for(const i of minorRoads)for(let e=0;e<i.length-1;e++)line(i[e].x*M,i[e].y*M,i[e+1].x*M,i[e+1].y*M);stroke(colourScheme.majorRoadColour),strokeWeight(colourScheme.majorWidth*M);for(const n of majorRoads)for(let e=0;e<n.length-1;e++)line(n[e].x*M,n[e].y*M,n[e+1].x*M,n[e+1].y*M);stroke(colourScheme.mainRoadColour),strokeWeight(colourScheme.mainWidth*M);for(const m of mainRoads)for(let e=0;e<m.length-1;e++)line(m[e].x*M,m[e].y*M,m[e+1].x*M,m[e+1].y*M);if(rectMode(CENTER),noFill(),strokeWeight(45*M),stroke(colourScheme.highlight),rect(WIDTH*M/2,HEIGHT*M/2,WIDTH*M,HEIGHT*M,50*M),strokeWeight(5*M),TRAITS.restDay)textAlign(CENTER,CENTER),fill(colourScheme.highlight),stroke(colourScheme.highlight),textSize(200*M),strokeWeight(20*M),text("REST",WIDTH*M*.5,HEIGHT*M*(1/3)),text("DAY",WIDTH*M*.5,HEIGHT*M*(2/3));else{fill(colourScheme.bgColour),rect(WIDTH*M/2,HEIGHT*M*.828125,WIDTH*M*.5,HEIGHT*M/4,30*M),stroke(colourScheme.highlight),fill(colourScheme.highlight),strokeWeight(1.5*M),textAlign(CENTER),textSize(15*M),text("Distance:",WIDTH*M*.375,HEIGHT*M*.75),text("Moving Time:",WIDTH*M*.375,HEIGHT*M*.8125),text("Max Elevation:",WIDTH*M*.375,HEIGHT*M*.875),text("Avg Pace",WIDTH*M*.625,HEIGHT*M*.75),text("Elevation Gain",WIDTH*M*.625,HEIGHT*M*.8125),textSize(18*M),text(TRAITS.distance+" mi",WIDTH*M*.375,HEIGHT*M*(25/32));var t=Math.floor(TRAITS.time/3600);let e=Math.floor((TRAITS.time-3600*t)/60),o=Math.floor(TRAITS.time-3600*t-60*e);e<10&&(e="0"+e),o<10&&(o="0"+o),text(`${t}:${e}:`+o,WIDTH*M*.375,HEIGHT*M*(27/32)),text(TRAITS.maxElevation+" ft",WIDTH*M*.375,HEIGHT*M*(29/32));t=Math.floor(TRAITS.pace/60);let a=Math.floor(TRAITS.pace-60*t);a<10&&(a="0"+a),text(`${t}:${a} / mi`,WIDTH*M*.625,HEIGHT*M*(25/32)),text(TRAITS.elevationGain+" ft",WIDTH*M*.625,HEIGHT*M*(27/32))}}
class StreamlineGenerator{majorGrid;minorGrid;paramsSq;candidateSeedsMajor=[];candidateSeedsMinor=[];resolve;allStreamlines=[];streamlinesMajor=[];streamlinesMinor=[];allStreamlinesSimple=[];worldDimensions;origin;constructor(t,e,i){this.worldDimensions=e,this.origin=t,(this.params=i).dtest=Math.min(i.dtest,i.dsep),this.majorGrid=new GridStorage(this.worldDimensions,this.origin,this.params.dsep),this.minorGrid=new GridStorage(this.worldDimensions,this.origin,this.params.dsep),this.setParamsSq()}joinDanglingStreamlines(){for(const e of[!0,!1])for(const i of this.streamlines(e))if(!i[0].equals(i[i.length-1])){var t=this.getBestNextPoint(i[0],i[4]);if(null!==t)for(const s of this.pointsBetween(i[0],t,this.params.dstep))i.unshift(s),this.grid(e).addSample(s);t=this.getBestNextPoint(i[i.length-1],i[i.length-4]);if(null!==t)for(const r of this.pointsBetween(i[i.length-1],t,this.params.dstep))i.push(r),this.grid(e).addSample(r)}this.allStreamlinesSimple=[];for(const a of this.allStreamlines)this.allStreamlinesSimple.push(this.simplifyStreamline(a))}pointsBetween(t,e,i){var s=t.dist(e),r=Math.floor(s/i);if(0===r)return[];var a=e.copy().sub(t),n=[];let o=1,h=t.copy().add(a.copy().mult(o/r));for(o=1;o<=r;o++){if(!(.001<integrate(h,!0).magSq()))return n;n.push(h),h=t.copy().add(a.copy().mult(o/r))}return n}getBestNextPoint(t,e){var i=this.majorGrid.getNearbyPoints(t,this.params.dlookahead),s=(i.push(...this.minorGrid.getNearbyPoints(t,this.params.dlookahead)),t.copy().sub(e));let r=null,a=1/0;for(const h of i)if(!h.equals(t)&&!h.equals(e)){var n=h.copy().sub(t);if(!(n.dot(s)<0)){var o=distanceToSquared(t,h);if(o<2*this.paramsSq.dstep){r=h;break}Math.abs(s.angleBetween(n))<this.params.joinangle&&o<a&&(a=o,r=h)}}return r=null!==r?r.copy().add(s.div(s.mag()).mult(4*this.params.simplifyTolerance)):r}async createAllStreamlines(){return new Promise(t=>{this.resolve=t;let e=!0;for(;this.createStreamline(e);)e=!e;t()}).then(()=>this.joinDanglingStreamlines())}simplifyStreamline(t){var e=[];for(const i of t)e.push(createVector(i.x,i.y));return e}createStreamline(t){var e=this.getSeed(t);return null!==e&&(5<(e=this.integrateStreamline(e,t)).length&&(this.grid(t).addPolyline(e),this.streamlines(t).push(e),this.allStreamlines.push(e),this.allStreamlinesSimple.push(this.simplifyStreamline(e)),e[0].equals(e[e.length-1])||(this.candidateSeeds(!t).push(e[0]),this.candidateSeeds(!t).push(e[e.length-1]))),!0)}setParamsSq(){this.paramsSq=Object.assign({},this.params);for(const t in this.paramsSq)"number"==typeof this.paramsSq[t]&&(this.paramsSq[t]*=this.paramsSq[t])}samplePoint(){return createVector(R.random_dec()*WIDTH,R.random_dec()*HEIGHT).add(this.origin)}getSeed(t){let e=this.samplePoint(),i=0;for(;!this.isValidSample(t,e,this.paramsSq.dsep);){if(i>=this.params.seedTries)return null;e=this.samplePoint(),i++}return e}isValidSample(t,e,i,s=!1){let r=this.grid(t).isValidSample(e,i);return r=s?r&&this.grid(!t).isValidSample(e,i):r}candidateSeeds(t){return t?this.candidateSeedsMajor:this.candidateSeedsMinor}streamlines(t){return t?this.streamlinesMajor:this.streamlinesMinor}grid(t){return t?this.majorGrid:this.minorGrid}pointInBounds(t){return t.x>=this.origin.x&&t.y>=this.origin.y&&t.x<this.worldDimensions.x+this.origin.x&&t.y<this.worldDimensions.y+this.origin.y}streamlineTurned(t,e,i,s){return e.dot(s)<0&&(e=createVector(e.y,-e.x),i.copy().sub(t).dot(e)<0==0<s.dot(e))}streamlineIntegrationStep(t,e,i){var s,r;t.valid&&(t.streamline.push(t.previousPoint),(s=integrate(t.previousPoint,e)).magSq()<.01?t.valid=!1:(s.dot(t.previousDirection)<0&&s.mult(-1),r=t.previousPoint.copy().add(s),this.pointInBounds(r)&&this.isValidSample(e,r,this.paramsSq.dtest,i)&&!this.streamlineTurned(t.seed,t.originalDir,r,s)?(t.previousPoint=r,t.previousDirection=s):(t.streamline.push(r),t.valid=!1)))}integrateStreamline(t,e){let i=0,s=!1;var r=R.random_dec()<this.params.collideEarly,a=integrate(t,e),n={seed:t,originalDir:a,streamline:[t],previousDirection:a,previousPoint:t.copy().add(a),valid:!0},a=(n.valid=this.pointInBounds(n.previousPoint),a.copy().mult(-1)),o={seed:t,originalDir:a,streamline:[],previousDirection:a,previousPoint:t.copy().add(a),valid:!0};for(o.valid=this.pointInBounds(o.previousPoint);i<this.params.pathIterations&&(n.valid||o.valid);){this.streamlineIntegrationStep(n,e,r),this.streamlineIntegrationStep(o,e,r);var h=distanceToSquared(n.previousPoint,o.previousPoint);if((s=!s&&h>this.paramsSq.dcirclejoin?!0:s)&&h<=this.paramsSq.dcirclejoin){n.streamline.push(n.previousPoint),n.streamline.push(o.previousPoint),o.streamline.push(o.previousPoint);break}i++}return o.streamline.reverse().push(...n.streamline),o.streamline}}class RoadGenerator{streamlines;params;constructor(t){this.params=t}get roads(){return this.streamlines.allStreamlinesSimple}async generateRoads(){return this.streamlines=new StreamlineGenerator(createVector(0,0),createVector(WIDTH,HEIGHT),Object.assign({},this.params)),this.streamlines.createAllStreamlines()}}class Tensor{oldTheta;_theta;matrix;r;constructor(t,e){this.r=t,this.matrix=e,this.oldTheta=!1,this._theta=this.calculateTheta()}static get zero(){return new Tensor(0,[0,0])}get theta(){return this.oldTheta&&(this._theta=this.calculateTheta(),this.oldTheta=!1),this._theta}add(i){return this.matrix=this.matrix.map((t,e)=>t*this.r+i.matrix[e]*i.r),this.r=2,this.oldTheta=!0,this}scale(t){return this.r*=t,this.oldTheta=!0,this}getMajor(){return 0===this.r?Vector.zeroVector():createVector(Math.cos(this.theta),Math.sin(this.theta))}getMinor(){var t;return 0===this.r?Vector.zeroVector():(t=this.theta+Math.PI/2,createVector(Math.cos(t),Math.sin(t)))}calculateTheta(){return 0===this.r?0:Math.atan2(this.matrix[1]/this.r,this.matrix[0]/this.r)/2}}class GridStorage{gridDimensions;grid;dsepSq;origin;dsep;worldDimensions;constructor(t,e,i){this.dsep=i,this.origin=e,this.worldDimensions=t,this.dsepSq=i*i,this.gridDimensions=this.worldDimensions.copy().div(this.dsep),this.grid=[];for(let e=0;e<this.gridDimensions.x;e++){this.grid.push([]);for(let t=0;t<this.gridDimensions.y;t++)this.grid[e].push([])}}addPolyline(t){for(const e of t)this.addSample(e)}addSample(t,e){e=e||this.getSampleCoords(t),this.grid[e.x][e.y].push(t)}isValidSample(i,s=this.dsepSq){var r=this.getSampleCoords(i);for(let e=-1;e<=1;e++)for(let t=-1;t<=1;t++){var a=r.copy().add(createVector(e,t));if(!this.vectorOutOfBounds(a,this.gridDimensions)&&!this.vectorFarFromVectors(i,this.grid[a.x][a.y],s))return!1}return!0}vectorFarFromVectors(t,e,i){for(const s of e)if(s!==t)if(distanceToSquared(s,t)<i)return!1;return!0}getNearbyPoints(t,e){var i=Math.ceil(e/this.dsep-.5),s=this.getSampleCoords(t),r=[];for(let e=-1*i;e<=+i;e++)for(let t=-1*i;t<=+i;t++){var a=s.copy().add(createVector(e,t));if(!this.vectorOutOfBounds(a,this.gridDimensions))for(const n of this.grid[a.x][a.y])r.push(n)}return r}worldToGrid(t){return t.copy().sub(this.origin)}vectorOutOfBounds(t,e){return t.x<0||t.y<0||t.x>=e.x||t.y>=e.y}getSampleCoords(t){t=this.worldToGrid(t);return this.vectorOutOfBounds(t,this.worldDimensions)?createVector(0,0):createVector(Math.floor(t.x/this.dsep),Math.floor(t.y/this.dsep))}}class BasisField{_centre;_decay;_type;constructor(t,e,i,s,r){this._centre=t.copy(),this._size=e,this._decay=i,this._theta=s,this._type=r}getWeightedTensor(t){return this.getTensor(t).scale(this.getTensorWeight(t))}getTensorWeight(t){t=t.copy().sub(this._centre).mag()/this._size;return 0===this._decay&&1<=t?0:Math.max(0,1-t)**this._decay}getTensor(t){return 0===this._type?this.getGridTensor():this.getRadialTensor(t)}getGridTensor(){var t=Math.cos(2*this._theta),e=Math.sin(2*this._theta);return new Tensor(1,[t,e])}getRadialTensor(t){var t=t.copy().sub(this._centre),e=t.y**2-t.x**2,t=-2*t.x*t.y;return new Tensor(1,[e,t])}}
var S={name:"Strava",bgColour:"#d3d3d3",minorRoadColour:"#fff",minorRoadOutline:"#474B4F",majorRoadColour:"#A9A9A9",majorRoadOutline:"#A9A9A9",mainRoadColour:"#FC4C02",mainRoadOutline:"#D9D9D9",highlight:"#FC4C02"},F={name:"Forest",bgColour:"#014421",minorRoadColour:"#2E8B57",minorRoadOutline:"#006400",majorRoadColour:"#008000",majorRoadOutline:"#66CDAA",mainRoadColour:"#ADFF2F",mainRoadOutline:"#7FFF00",highlight:"#9ACD32"},D={name:"Desert",bgColour:"#EDC9AF",minorRoadColour:"#918675",minorRoadOutline:"#564138",majorRoadColour:"#B7A57A",majorRoadOutline:"#764134",mainRoadColour:"#D4AF37",mainRoadOutline:"#97694F",highlight:"#6D597A"},O={name:"Ocean",bgColour:"#1B98E0",minorRoadColour:"#132B55",minorRoadOutline:"#0D1B2A",majorRoadColour:"#DDE1E4",majorRoadOutline:"#C8D3D5",mainRoadColour:"#C6D8D3",mainRoadOutline:"#BCD8DB",highlight:"#0D1B2A"},A={name:"Autumn",bgColour:"#FF8300",minorRoadColour:"#DB9019",minorRoadOutline:"#A3721E",majorRoadColour:"#645244",majorRoadOutline:"#322410",mainRoadColour:"#FFFFFF",mainRoadOutline:"#EBEBEB",highlight:"#76323F"},T={name:"Tropical",bgColour:"#0081A7",minorRoadColour:"#FED9B7",minorRoadOutline:"#F07167",majorRoadColour:"#F07167",majorRoadOutline:"#6A057F",mainRoadColour:"#B83B5E",mainRoadOutline:"#6A057F",highlight:"#FBFF12"},AM={name:"Ambr0sia",bgColour:"#d1b4bf",minorRoadColour:"#ff8657",minorRoadOutline:"#ff8657",majorRoadColour:"#374f9b",majorRoadOutline:"#374f9b",mainRoadColour:"#060622",mainRoadOutline:"#7a5cee",highlight:"#7a5cee"},C=[S,F,D,O,A,T,AM];
class Random{constructor(){this.useA=!1;function n(n){let t=parseInt(n.substring(0,8),16),r=parseInt(n.substring(8,16),16),s=parseInt(n.substring(16,24),16),e=parseInt(n.substring(24,32),16);return function(){t|=0,r|=0,s|=0,e|=0;var n=(t+r|0)+e|0;return e=e+1|0,t=r^r>>>9,r=s+(s<<3)|0,s=(s=s<<21|s>>>11)+n|0,(n>>>0)/4294967296}}this.prngA=new n(tokenData.hash.substring(2,34)),this.prngB=new n(tokenData.hash.substring(34,66));for(let n=0;n<1e6;n+=2)this.prngA(),this.prngB()}random_dec(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}random_num(n,t){return n+(t-n)*this.random_dec()}random_int(n,t){return Math.floor(this.random_num(n,t+1))}random_bool(n){return this.random_dec()<n}random_choice(n){return n[this.random_int(0,n.length-1)]}}
fifty-five fake runs is all about the Noble Challenge. It's about getting 1% better every day and trusting the process of growth with consistent intentional effort. It's about holding yourself accountable to your goals. It's about a long life full of steady improvement and progress towards those goals. Finally, it's about the importance of rest. Without rest, there is no growth. It can be easy to get trapped in the monotony of always-on consistent activity. Taking a break can be difficult, but is the most necessary part of the process. Cheers! To all those who are committed to being better everyday. The Noble ones.