graphicsdrawingcomputational-geometrycartesian-coordinatesline-drawing

Drawing a set of parallel lines at various angles for finding the mean intercept length


I am trying to write a code to find the Mean Intercept Length tensor. The mean intercept length tensor will help me find the orientation of a given image. For that I need to create a set of parallel sample lines equidistant from each other filling the whole grid. These equidistant parallel lines should also be oriented in various angles. If there is any existing code for creating the set of parallel lines or for the mean intercept length it would be helpful. Also it's better if the code is in FORTRAN.Set of parallel lines Intercepts measured from the sample lines


Solution

  • Consider normal (rho-theta) equation of line

    x * Cos(Theta) + y * Sin(Theta) - Rho = 0
    

    Here Theta is angle between OX axis and normal from the coordinate origin to the line. Rho is length of this normal.

    So to generate set of parallel lines with given angle, you can use this equation with Rho walking through some range with needed step (line-line distance)