EZPLOT tangent curve gets cut off - plot

I'm trying to draw a tangent plot using the EZPLOT function.
For some reason the tangent gets cut off on the y axis after a certain value.
Is there a way of setting ezplot's y axis range of drawing?

Related

Draw quadratics with it crossing the x and y axis with points labled

I'm trying to draw curves and I need to have it crossing the x and y axis with where it crossing shown clearly on the graph.
Im using the code
curve(x^2-8*x+16, -2, 10)
this is making the curve I want but not showing the curve clearly crossing the axis
I have used Desmos to show what im aiming to create.

Calculating the euler angles of a line relative to three axes

I have asked a question similar to this before but have since got further and also didn't tag the question right and wanted to get a bit of help on the maths around the question if possible.
I have a 3D sphere with points evenly spaced on its surface of which I know the coordinates. From these coordinates I am trying to define the orientation of some spikes that are coming out of the surface of my sphere along the vector between the centre of the sphere and the point at which the coordinates lie.
The idea is these euler angles will be very helpful in later aligning the spikes so they are all in roughly the same orientation if I am am to box out all of the spikes from an image.
Since the coordinates on the sphere are evenly spaced i can just take the average x, y and z coordinates to give me the centre and I can then draw a vector from the centre to each coordinate in turn.
The euler angles I need to calculate in this case are initially around the z axis, then around the new y axis, and finally again around the new z axis.
My centre point is currently being defined as the average coordinate of all my coordinates. This works as the coordinates are evenly spaced around the sphere.
I then use the equation that states
cos(theta) = dot product of the two vectors / magnitude of each vector multiplied together
on the x and y axis. One of my vectors is the x and y of the vector i am interested in whilst the other is the y axis (0,1). This tells me the rotation around the z axis with the y axis being 0. I also calculate the gradient of the line on this 2D plane to calculate whether I am working between 0 and +180 or 0 and -180.
I then rotate the x axis about the angle just calculated to give me x' using a simple 2D rotation matrix.
I then calculate the angle in the same way above but this time around the y axis using x' and z' as my second vector (where z' = z).
Finally I repeat the same as stated above to calculate the new z'' and x'' and do my final calculation.
This gives me three angles but when I display in matlab using the quiver3 command I do not get the correct orientations using this method. I believe I just do not understand how to calculate euler angles correctly and am messing something up along the way.
I was hoping someone more knowledgeable than me could take a glance over my planned method of euler angle calculation and spot any flaws.
Thanks.

Formula to draw arcs ending in straight lines, Y as a function of X, starting slope, ending slope, starting point and arc radius?

I'm looking for a math formula that on a graph plotting Y as a function of X, before a specified starting point (a value of X, or even better, X and Y coordinates) will have a certain slope, then after that it will draw an arc of a specified radius that will end when it reaches a second specified slope, and from the point on will be another straight line of that second slope.
I'm am aware that because it's Y as a function of X, the slope parameters would need to be bigger than exactly -90 and smaller than exactly 90 degrees; i'm not worried about any misbehavior at (or beyond) those extremes.
Actually, i would be even happier with a formula that takes a starting and ending points (2d coordinates), and starting and ending slopes; and will have two arcs in between (with a straight line between them when needed), connecting the two straight lines seamlessly (obviously the X of the ending point needs to be bigger than the X for the starting point; i don't care what happens when that isn't the case). But i imagine such a formula might be much harder to come up with than what i asked first.
ps: by "arc" i mean segment of a circle; as in, if both axes of the graph have the same scale, the arcs will have the correct aspect ratio for a circle of the same radius.
Well I see it like this:
compute P0
as intersection of lines A + t*dA and B - t*dB
compute P1 (center of circle)
it is intersection of translated lines A->P0 and B->P0 perpendicular by radius r. There are 2 possibilities so choose the right one (which leads to less angle of circular part).
compute P2,P3
just an intersection between lines A-P0 and B-P0 and perpendicular line from P1 to it
the curve
// some constants first
da=P2-A;
db=B-P3;
a2=atan2(P2.x-P1.x,P2.y-P1.y);
a3=atan2(P3.x-P1.x,P3.y-P1.y);
if (a2>a3) a3-=M_PI*2.0;
dang=a3-a2;
// now (x,y)=curve(t) ... where t = <0,3>
if (t<=1.0)
{
x=A.x+t*da.x;
y=A.y+t*da.y;
}
else if (t<=2.0)
{
t=a2+((t-1.0)*dang);
x=P1.x+r*cos(t);
y=P1.y+r*sin(t);
}
else
{
t=t-2.0;
x=P3.x+t*db.x;
y=P3.y+t*db.y;
}

Using Matlab, how does the visual geometric angle of a regression line change as I alter the axes of the graph?

I know that you can adjust the scale of the x and y axes to change the geometric angle of a regression line. For example, if you plotted a regression line with slope of b=0.3, perhaps the default settings of axes length etc. would create a regression angle of 35 degrees.
If you adjust the axes, you will change the angle the regression line makes with the x-axis so that it is greater or less than 35 degrees-WITHOUT changing the mathematical value of the slope--it will still stay as b=0.3.
What systematic equation/set of equations is there that allows me to know how the geometric angle of the regression line will be changed as I change the axes of the graph itself?
I have spent a lot of time on the internet looking for the answer to this and have not yet succeeded. For some reason statistics and geometry do not overlap much.
Refer to this web page: http://www.mathworks.in/help/matlab/ref/axis.html
Based on the data you have, set the same ranges for all the axes in your plot. Then the regression line would have the same angle for both the datasets.
Hope this helps!

how can i construct the bezier curve if i only have points in x axis?

how can i construct the bezier curve if i only have points in x axis?can i do this act or need points for x and y axes related to t parameter?
i want constructe a bezier curve(from degree N)in a given interval and known point in that interval(that are random), but i have points only in x axes!!Whether this is feasible?
Can you specify the slopes at the end-points. You will need to do this for any bezier curve, The fact that the data points are on the x-axis is irrelevant.

Resources