class walker{
constructor(ctx,x,y,theta){
this.ctx = ctx
this.x = x
this.y = y
this.theta = theta
}
step(stepSize){
const dx = stepSize*Math.cos(this.theta)
const dy = stepSize*Math.sin(this.theta)
const x2 = this.x + dx
const y2 = this.y + dy
this.ctx.beginPath()
this.ctx.moveTo(this.x,this.y)
this.ctx.lineTo(x2,y2)
this.ctx.stroke()
this.ctx.closePath()
}
changeTheta(){
const dtheta = d3.randomUniform(-Math.PI/6,Math.PI/6)()
this.theta = this.theta + dtheta
}
}