Draw a square with one line?

2 次查看(过去 30 天)
Krasimir Terziev
Krasimir Terziev 2020-6-18
Hello,
Is it possible to draw a square with one line?
What I mean is I got a line that I know, lets say x=[0,0], y=[0,1]; and I want to make a square with that line. In real life if I want a square I need only one line and I will make it because I know other lines are the same length.
The thing I am looking for is that I got a different X and Y data. I mean I got an exponential line so when the Y=1 my X is (lets say) 0.2412.
So I want to know when my Y= 2 what will be my X? DON'T FORGET THAT LINE IS EXPONENTIAL so if Y=1 and X=0.2412 then Y=2 is NOT X=2*(0.2412)
Thats why I want to make a square and guess the X data when I know the Y.
On the picture below is my problem. I want to know what is the X value when my Y is known ( the "+" on 0.025X).
The line from y=0 to y="+" is have to fall down and the tip of the line is my X searching value!!!!
THANK YOU A LOT!
  5 个评论
Krasimir Terziev
Krasimir Terziev 2020-6-18
编辑:Krasimir Terziev 2020-6-18
i hope this picture will explane you what i mean.
i know the Y+ value and i need to know the X+ value but the X and Y value have bigger difference( i mean Potokm1 from code above - the Y values are bigger then - Tokm3 values)
Krasimir Terziev
Krasimir Terziev 2020-6-18
I thing this will help us to see where the points comes from.
i really appreciate ur help!

请先登录,再进行评论。

回答(1 个)

Mara
Mara 2020-6-18
Not sure I have understood your problem. I think you want to find out x by drawing an orthogonal line from the y-axis, but I do not understand why because you seem to have the x data and the exponential function already.
I will try to answer to 2 possible problems
1.
You know your exponential function, then you can calculate x.
Let's say your exponential function is y = 4^x. Let's say y is 50.
(got this example here) Citing:
With the above information, you're ready to try solving for an exponent in an equation.
If you take the log to the base 10 of each side and omit explicit identification of the base, this becomes log 50 = log 4x.
log 50 = x log 4, or x = (log 50)/(log 4).
2.
You don't know your exponential function, but if you have plotted the result, you must have the x and y data somewhere.
So you can find it by indexing into the vectors that you plotted with. Let's again say you want the x value where y is 50.
plot(x, y);
y_index = find(y==50); % find the index in the ydata where y is 50
x_value = x(y_index); % index into the xdata
  2 个评论
Krasimir Terziev
Krasimir Terziev 2020-6-18
ok, will show you with a figure what i cant find.
On the picture down below i need to find the value of POINT ONE (p.1).
i just need somethink like circle with radius of one but my X value is smaller the my Y so if i write radius 1 THE circle became a Ellipse and i cant do notfing.
Just like a vector with the length of y=point 1 to fall down and how me the value of X.
THANGS FOR HELPING ME !
Mara
Mara 2020-6-18
I am sorry, I cannot help you with this!

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by