graphing non connected line segments, using matrices
- November 16, 2010
- 2 replies
- 6131 views
I want to be able to graph a variable number of line segments, which may or may not be connected.
Say: P1 to P2, P3 to P4, P1 to P4, etc.
Can easily do by just plotting x-y corrdinate pairs for each end (x1 x2) and (y1 y2), but then I must include each set in the graph individually.
Plese see the attached; it seems that to be assured of getting the desired result I must do the following:
Each row of the X and Y matrices contains the corrdinates of each end of the segment, but I must add to that as follows:
each row of X ( xP1 - xP2 - xP1 - xLarge), Y (yP1 - yP2 - yP1 - yLarge)
and then in addition I must add a reference to a non-existant point. (j=0 to 5, instead of 4)
This is the only way I ave been able to "pick up and move the pen" to another piont.
I am almost embarrased to post that because it makes no sense, but maybe it does?
Is there a coherent explaniation for this? Is there a better way?
Thanks,
Wayne

