i'm getting 'divide by zero' exception here.what is the method to fix this error?
Naman2007
Posts
-
slope of a line -
slope of a linei tried to put x and y coordinates in two different arrays but don't understand how to write a code that calculates the slope between points and displays them in a textbox. i have written the following code snippet:
var r = File.ReadAllLines(path)
.Select(line => line.Split(' '))
.Select(arr => new
{
Column0 = Int32.Parse(arr[0]),
Column1 = Int32.Parse(arr[1])
// etc
})
.ToArray();
int[] column0 = r.Select(x => x.Column0).ToArray();
int[] column1 = r.Select(x => x.Column1).ToArray(); -
slope of a lineI have a text file containing the following content:
0 12
1 15
2 6
3 4
4 3
5 6
6 12
7 8
8 8
9 9
10 13the first column specifies the x coordinate of a point and second column specifies the y coordinate.i need to read this file and find slope between all points. like first i find slope between (0,12) and (1,15) and then between (0,15) and (2,6) and so on.i am basically building a wpf application.can anyone help?
-
record mouse coordinates when mouse is clicked on inkcanvasits WPF
-
record mouse coordinates when mouse is clicked on inkcanvasI want to get the cursor coordinates when the mouse is clicked in inkcanvas.here i used mouse event handler and i am trying to display cordinates in a textbox but somehow its not working.i have used the following code snippet.can someone please help
private void inkCanvas1_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
System.Windows.Point position = e.GetPosition(this);
this.textBox1.Text = position.X.ToString()+","+position.Y.ToString();
} -
C++ Codingcould anyone help me with the projrct on streamline allocation i.e i need a complete coding for this project.actually in this C++ program i have to allocate marks to students on the basis of their performance in exams