Commit 1029d313 authored by Neil Gershenfeld's avatar Neil Gershenfeld
Browse files

wip

parent 590bbfcb
......@@ -229,28 +229,25 @@ function calculate_path() {
//
var step = 1
var ix = 0
var iy = 0
var iy = 10
var x1 = mod.xmin+(mod.xmax-mod.xmin)*ix/(mod.width-1)
var y1 = mod.ymin+(mod.ymax-mod.ymin)*iy/(mod.height-1)
while (1) {
var x = mod.xmin+(mod.xmax-mod.xmin)*ix/(mod.width-1)
var y = mod.ymin+(mod.ymax-mod.ymin)*iy/(mod.height-1)
console.log(x,y)
ix += step
if (ix == mod.width)
break;
var x2 = mod.xmin+(mod.xmax-mod.xmin)*ix/(mod.width-1)
var y2 = mod.ymin+(mod.ymax-mod.ymin)*iy/(mod.height-1)
var line = document.createElementNS('http://www.w3.org/2000/svg','line')
line.setAttribute('stroke','black')
line.setAttribute('stroke-width',1)
line.setAttribute('stroke-linecap','round')
line.setAttribute('x1',x1)
line.setAttribute('y1',y1)
line.setAttribute('x2',x2)
line.setAttribute('y2',y2)
g.appendChild(line)
}
var line = document.createElementNS('http://www.w3.org/2000/svg','line')
line.setAttribute('stroke','black')
line.setAttribute('stroke-width',1)
line.setAttribute('stroke-linecap','round')
var x1 = 0
var y1 = 0
var x2 = mod.width
var y2 = mod.height
line.setAttribute('x1',x1)
line.setAttribute('y1',y1)
line.setAttribute('x2',x2)
line.setAttribute('y2',y2)
g.appendChild(line)
mod.label.nodeValue = 'calculate'
mod.labelspan.style.fontWeight = 'normal'
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment