Rotation of X-axis by 180 degrees - geometry

Rotating Y-axis about 180 degrees cause a flip for X and Z. Is that also valid that rotating about the X-axis 180 degrees cause a flip for Y and Z?

Related

gnuplot not showing correct scale on y axis for a circle

I am modelling a graph problem using gnuplot
I am plotting a circle with gnuplot using the following command
set xtics 1
set ytics 1
plot 'circles.txt' with circle
my circles.txt contains the follwoing data
0 0 3
the upmost point on this circle(center at origin and radius of 3 ) should be (0,3) but it is shown as (0,2) in this graph
how can i rectify this error?
Plotting with circles is intended for plotting the points as circles so they would be round regardless of axes scaling. As it is pointed in gnuplot documentation,
The radius is always interpreted in the units of the plot's horizontal axis (x or x2). The scale on y and the aspect ratio of the plot are both ignored.
You can plot with ellipses instead; from documentation on plot with ellipses:
2 columns: x y
3 columns: x y major_diam
4 columns: x y major_diam minor_diam
5 columns: x y major_diam minor_diam angle
so you plot this as
plot 'circles.txt' using 1:2:($3*2):($3*2) with ellipses
(ellipses use diameter, so the size should be the third column twice)
Or set object ellipse:
set object ellipse at 0, 0 size 6, 6

Converting plot X, Y to location to draw arrow/line

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

Converte circle coordinates in to degree values in gnuplot

I have a data file with 3 columns: The first 2 are coordinates of a circle, the 3. are results . How can I convert this x-y-coordinates into a range of degree (range of the x-axis: 0 - 360). I want to show results in a XY-plot. I don't want to create a further column in my data file, I want to convert the values directly with gnuplot. Is this possible?
Just remember your high school geometry and how to convert Cartesian coordinates to polar coordinates. Suppose you have a Cartesian coordinate (x, y). Draw a line between this point and the origin. The angle θ between this line and the x-axis is related by tan θ = y/x and the distance r from the origin is sqrt(x2 + y2).
So your angle θ is just the arc tangent (inverse tangent) of y/x. In gnuplot, this is the atan() function. I'd write something like this:
set angles degrees
plot 'infile.dat' using (atan($2/$1)):3 with points
where column 3 is your "result" (the roughness) and columns 1 and 2 are your Cartesian coordinates. It uses the calculated θ value for the horizontal plotted axis and the roughness for the vertical plotted axis.
The set angles command lets you set the unit used by atan() to degrees or radians. Since you specified a range of 0-360, it is set angles degrees.
It will plot the points in the order as they appear in the file. Notice that depending on the order of points in your data file, the order of the points after this calculation may no longer be visually sequential, so this example uses with points.

Calculate angle to translate the circle at the 90 degree on an arc

I have one design like this:
Now i want to calculate angle between the clicked circle and the position at 90 degrees on outer arc. How do i calculate that ?
I have angle of outer circles in radians.

Forming right triangle with given hypotenuse and angles

I have two points A=[ax,ay] and B=[bx,by] and i have angle in right triangle for CAB, for CBA (thats 90-ACB) and for ACB (90, right angle). Now i want to get coordinates [cx,cy] of point C (from two possibilities, i want that one C point which lies to left of orientated line segment form A to B).
How should I do it?
Calculate middle point D=(A+B)/2
Rotate vector DB on angle 2*CAB
(this is based on facts that centre of circumscribed circle is the middle of hypotenuse and that angle from centre is twice angle from A)
let's B-D=(dx,dy)
then C=D+(dx*cos2a+dy*sin2a,dy*cos2a-dx*sin2a)
Since you're given a side and two adjanced angles, what's left is to construct the the lines for the other two sides and intersect them.
Rotate the vector A->B by the angle BAC to the left, rotate the vector B->A by the angle ABC to the right and intersect.
To rotate a vector to the left, multiply it by the rotation matrix:
cos(a) sin(a)
-sin(a) cos(a)
To intersect two lines in their parametric forms in 2D, solve both parameters simultaneously, comparing the two components for both lines.

Resources