Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

contour plot not working as expected

Hi all,

I am looking at ways to determine the sign of an angle between a reference vector (a,b) and any other vector(x,y) of the plane. To do so, I have decided to use the determinant of the matrix: [[a b],[x y]] which equals ax-by. I wanted then to check that the formula works by displaying the plane area which positive and negative signs using the contour_plot.

Here is my question:

Why is the 3rd graph not showing 2 horizontal areas instead of the vertical displayed?

var('x y') f(x,y,a,b)=(ay-bx)/abs(ay-bx) plota1b1=contour_plot(f(x,y,1,1),(-10,10),(-10,10),cmap='jet',colorbar=true) plota0b1=contour_plot(f(x,y,0,1),(-10,10),(-10,10),cmap='jet',colorbar=true) plota1b0=contour_plot(f(x,y,1,0),(-10,10),(-10,10),cmap='jet',colorbar=true) show(plota1b1) show(plota0b1) show(plota1b0)

Thanks

click to hide/show revision 2
No.2 Revision

contour plot not working as expected

Hi all,

I am looking at ways to determine the sign of an angle between a reference vector (a,b) and any other vector(x,y) of the plane. To do so, I have decided to use the determinant of the matrix: [[a b],[x y]] which equals ax-by. I wanted then to check that the formula works by displaying the plane area which positive and negative signs using the contour_plot.

Here is my question:

Why is the 3rd graph not showing 2 horizontal areas instead of the vertical displayed?

var('x y')
f(x,y,a,b)=(ay-bx)/abs(ay-bx)
f(x,y,a,b)=(a*y-b*x)/abs(a*y-b*x)
plota1b1=contour_plot(f(x,y,1,1),(-10,10),(-10,10),cmap='jet',colorbar=true)
plota0b1=contour_plot(f(x,y,0,1),(-10,10),(-10,10),cmap='jet',colorbar=true)
plota1b0=contour_plot(f(x,y,1,0),(-10,10),(-10,10),cmap='jet',colorbar=true)
show(plota1b1)
show(plota0b1)
show(plota1b0)

show(plota1b0)

Thanks

contour plot not working as expected

Hi all,

I am looking at ways to determine the sign of an angle between a reference vector (a,b) and any other vector(x,y) of the plane. To do so, I have decided to use the determinant of the matrix: [[a b],[x y]] which equals ax-by. I wanted then to check that the formula works by displaying the plane area which positive and negative signs using the contour_plot.

Here is my question:

Why is the 3rd graph not showing 2 horizontal areas instead of the vertical displayed?

var('x y')
f(x,y,a,b)=(a*y-b*x)/abs(a*y-b*x)
plota1b1=contour_plot(f(x,y,1,1),(-10,10),(-10,10),cmap='jet',colorbar=true)
plota0b1=contour_plot(f(x,y,0,1),(-10,10),(-10,10),cmap='jet',colorbar=true)
plota1b0=contour_plot(f(x,y,1,0),(-10,10),(-10,10),cmap='jet',colorbar=true)
show(plota1b1)
show(plota0b1)
show(plota1b0)

Thanks