using System;
using System.Collections.Generic;
using System.Text;
namespace Mishvat_Kav_Yashar
{
class Shipoa_And_Kav_Yashar
{
static void Main(string[] args)
{
float x1, x2, y1, y2;
float m;
float sol1, sol2, sol3, way1, way2, solw12;
Console.WriteLine("Enter Y1 coordinate: "); // (Y1,Y2)
y1 = float.Parse(Console.ReadLine());
Console.WriteLine("Enter Y2 coordinate: "); // (Y1,Y2)
y2 = float.Parse(Console.ReadLine());
Console.WriteLine("Enter X1 coordinate: "); // (X1,X2)
x1 = float.Parse(Console.ReadLine());
Console.WriteLine("Enter X2 coordinate: "); // (X1,X2)
x2 = float.Parse(Console.ReadLine());
m = ((y2 - y1) / (x2 - x1)); // נוסחה לחישוב שיפוע
way1 = y2 - y1;
way2 = x2 - x1;
solw12 = way1 / way2;
Console.WriteLine();
Console.WriteLine(" {0} - {1} {2}", y2, y1, way1);
Console.WriteLine("m = ----- = -- = {0}", solw12);
Console.WriteLine(" {0} - {1} {2}", x2, x1, way2);
Console.WriteLine("The shipoa is" + m);
Console.WriteLine();
Console.WriteLine("y-{0}={1}(x-{2})", y1, m, x1);
sol1 = (m * 1);
sol2 = (m * x1*-1);
if (m == 0)
{
Console.WriteLine("y-" + y1 + "=0");
Console.WriteLine("y" + "=" + y1);
}
else
{
Console.WriteLine("y-" + y1 + "=" + sol1 + "x" + "+" + sol2);
Console.WriteLine("y" + "=" + sol1 + "x" + "+" + sol2 + "+" + y1);
}
sol3 = sol2 + y1;
if (sol1>0)
Console.WriteLine("y" + "=" + sol1 + "x" + "+" + sol3);
if (sol1<=0)
Console.WriteLine("y" + "=" + sol1 + "x" + sol3);
}
}
}