basilius
basilius

Reputation: 65

How update intersection when an angle.Value() change

I have a construction that starts with a point and a segment. Later I have an intersection. The correct output of the intersection depend if the 3.rd parameter i is 0 or 1. The point and the line are not part of create('intersection'.... If 0 or 1 depends where the point is relative to the line. Is it above or left the line it is 1 otherwise 0. So I thougt I create an angle between the the point and the segment and decide if the angle is less pi. Statically this works, but how do I update the intersection, if I move the point or the segment?

Best regards basil

Upvotes: 0

Views: 23

Answers (1)

Alfred Wassermann
Alfred Wassermann

Reputation: 2323

At the moment (i.e. v1.5.0) dynamic values for the intersection number are not supported. But this is a very good suggestion. We included it into the source, it will be available in 1.5.1. Here is an example how to use it:

var ci = board.create('circle', [[0, 0], 3]);
var li = board.create('line', [[-3, -3], [4, 1]]);

var sl = board.create('slider', [[1,4], [2,4], [0, 0, 1]], 
            {snapWidth: 1, name:'i', digits:0});
var is = board.create('intersection', [ci, li, () => sl.Value()]);

Upvotes: 0

Related Questions