Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

A method you can use is finding the furthest points from all the lines and drawing a line from those points. For example, if the line is horizontal store the x value and y value of that point only if the x value is the lowest x found. Same for highest x.

A method you can use is finding the furthest points from all the lines and drawing a line from those points. For example, if the line is horizontal store the x value and y value of that point only if the x value is the lowest x found. Same for highest x.x. For paper, do this for separately for y values above the middle of the paper and y values below the middle of the paper.

click to hide/show revision 3
Summary: Search all lines for end points

A method

  1. Make a new function to calculate the slope of a line by using the 2 points in a single line. You can do this with the y and x values of the line's points. Do this for every line.
  2. Use the gradient to separate between horizontal lines and vertical looking lines
  3. Find the end points of the line you can use is finding want to draw by search end points by searching the furthest end points from of all the lines according to gradient and drawing place where you might see that point.

An example for part 3, to find these points is when searching a line from those points. For example, if the line is horizontal store line: Use gradient function to filter horizontal lines, then search the x value and y value values of that point only if the x value is all points to keep the lowest x found. Same for and highest x. For paper, do this for separately for y values above the middle of the paper and y values below the middle of the paper.x only.

  1. Make a new function to calculate the slope of a line by using the 2 points in a single line. You can do this with the y and x values of the line's points. Do this for every line.
  2. Use the gradient to separate between horizontal lines and vertical looking lines
  3. Find the end points of the line you want to draw by search end points by searching the end points of all the lines according to gradient and place where you might see that point.

An example for part 3, to find these points 3 is when searching a horizontal line: Use gradient function to filter horizontal lines, then search the x values of all points to keep the lowest x and highest x only.