I have 4 points. If I were to draw lines from every point to every other point, I will get 4 exterior lines and 2 lines crossing in the middle. What I'm trying to identify is the point at which the 2 crossing lines intersect. All I know is the coordinates of each of the 4 points (x0, y0, x1, y1, x2, y2, x3, y3).
Is there a simple solution to this that I'm missing?
Edit: Edit: Fixed. I was missing the two formulas: x = x1 + ua (x2 - x1) and
y = y1 + ua (y2 - y1).
There is nothing special in intersection of quadrilateral diagonals. Just use any approach for intersection of two line segments. Wiki (note that perhaps point order differs from yours)
Related
I have a bunch of data that I'm plotting as point plots. The data is simply a column for X and a column for Y. The catch here though is this is plotted using axes x2y2.
The x1y1 is used for a histogram. The X axis is the same range for both plots.
I know how to derive the X coordinate, but am wondering if there is an easy way to determine the Y value to use to draw an arrow. I want to draw an arrow callout for an arbitrary point on the point plot.
y1 and y2 are independent.
The coordinates for drawing the arrow can refer to different coordinate systems (first, second, character, screen, and graph, see help coordinates).
So, to draw an arrow e.g. from the top-middle of the plot (graph 0.5, graph 1) to x2 = 1, y2 = 2 (second 1, second 2) you would write
set arrow from graph 0.5, graph 1 to second 1, second 2 head
I am quite new to gnuplot. And I've got problem with secondary y axis. When I try to plot two curves into one graph with two different y axis, the second one is moved down a little bit. I mean that if you draw a straight line parallel to the x axis at y1 = 0, you get different y2 values. I want both y axes to start at the same point y1=0 ~ y2=0.
Here is the picture better describing my problem:
I have two curves; Curve 1 (x1, y1), Curve 2 (x2, y2) in which the value of x2 is equal z times of the value of x1 (e.g., x2 = 1.5 * x1); y axis value is not change. I would like to plot two curves in the same proportion of the x axis value, i.e. i want to change the proportion of x2 value to the x1 value in order to same the peaks of two curves above.
I had tried to find a lot of supports in internet but it has not any suitable result.
Many thanks for your helps.
I just feel pretty stupid, because I can't find a solution for my problem. Maybe someone can help me please:
I have the values Y1 and X1 (where X1 is always bigger than Y1). If I want to draw a curve between the two points y1, x1 based on a circle (no ellipse), how to find out the y2 value which would be the center of the cycle and the radius (r)? I think the circle's radius would get bigger and it's center would move down on the y-axis the greater x1 is (if Y1 doesn't change), right?
This is simply a math question.
First of all you should find the middle of the two points Y1 (0,10) and X1 (20,0)
which is (10,5).
Now we should determine the slope of the line which is perpendicular on the line between X1 and Y1. That slope is equal to 20/10=2
Thus the equation of that line will become y-5=2*(x-10) and thus y=2x-15
To find the coordinates of Y2 we have to find the point where the x value is 0. that is on y=-15. Thus the Y2 coordinate is (0,-15).
You can find the value for Y2 in the same way for other values than 20 and 10.
I have a grid of x,y points that are (as far as gnuplot is concerned) unstructured. I would like to plot a variable on that grid using gnuplot's pm3d. Currently, I'm constructing a delaunay tesselation and writing each triangle into the datafile as a separate dataset. for example, the datafile looks something like this:
#triangle 1
x1 y1 c1
x2 y2 c2
x3 y3 c3
x3 y3 <c1+c2+c3>/3.
#triangle 2
x1 y1 c1
x2 y2 c2
x3 y3 c3
x3 y3 <c1+c2+c3>/3.
#triangle 3
...
This seems to work Ok, but I was wondering if there a better way to accomplish this? (if it matters, I'm using Python+Delny interface to construct the delaunay tesselation)
Apparently the above solution is as good as I'm going to find. If you have a better way to plot unstructured data in gnuplot, other than dgrid3d, I'd love to hear it!