Although you haven't given any line equations, I can tell you how to do this sort of problem.
Get the linear equation into the form y=ax+b, where a is the slope and b the y intercept (when x=0).
Let the point (X,Y) on the line be the point where the perpendicular passes through it.
The equation of the perpendicular will be y=-ax+c, so we have to find c. -a is at right angles to a.
We know the perpendicular must pass through (X,Y) so Y=-aX+c and therefore c=Y+aX.
Remember X and Y are not variables but actual numbers like a, so c will be a number.
The linear equation for the perpendicular is y=-ax+Y+aX.