# Nomogram

This nomogram was created by Jethro Berelson with consultation and advice from Professor Thomas Jones . It was updated by Ross Camara and Allison Marrero. Here is a demonstration of how a nomogram is created for a simple addition equation with this program:
After the user has entered all of the parameters for the nomogram, the left and right scales are drawn (representing the variable 'A' and 'B'). The min and max values on these scales are labeled based on the user inputs for these variables, and then based on the difference between the min and max values the program calculates the "unit space", which is the pixel distance between integer values on the scale. One example would be if the difference between the min and the max is 10, and the total pixel distance is 5, then the "unit space" is 2. Labeling the scales is done by the program simply picking the smallest integer spacing which is 20 pixels apart. Of course, this interval for the scales may not be what the user wants so the user is allowed to enter an arbitrary spacing.

Next, the program has to figure out where the middle scale (for variable 'C') should go. The positioning of the scale is what makes the nomogram look graphically correct. The positioning is done by drawing two lines which cross the left and right scales at different positions, such that the values of the scales for both lines both add up to the same value. For instance, the first line may have a value of 0 on the left scale and 100 on the right scale, and the second line may have a value of 50 on each scale. So, both of these lines have values that add up to 100. Once these two lines have been drawn, wherever they cross is where the middle scale should be drawn. The program figures out the middle scale positioning by first drawing a line from the min of the left scale to the max of the right scale, and then drawing a line from the min of the right scale to a value on the left scale such that the sum of the min and max of the two lines are equivalent. It then computes where these two lines meet, and this is the middle scale position.

Now that we know where the middle scale should be placed, it is labeled in the same manner as the other two scales, and thus the nomogram is completed. The user can begin drawing a lines on the nomogram so that the program can compute the values of the variables corresponding to the line. This is done by first finding the slope and y-intercept of the line and once the equation of the line is computed, the point where the line intercepts the three scales is calculated and the values of the left and right scales are estimated based on where the line intersects the scale. The value of the middle scale is computed based on the values of the other two variables, and the parameters for the equation being used.