필터 지우기
필터 지우기

How to drag an fimplicit function

조회 수: 1 (최근 30일)
Saikat Banerjee
Saikat Banerjee 2020년 7월 15일
댓글: Walter Roberson 2020년 7월 19일
I have a typical problem I want to solve the intersection point of two polynomial curves by moving the curves within specific limits of X and Y. My problem is let's say we have equation of two 2Dimensional circles say x^2 + y^2 + 5*x + 12*y +15 and x^2 + y^2 -18*x -22*y -24. Now I want to drag both the circles within specific limits of x and y and if the two circles intersect each other simultaneously solve the point of intersections and display them along with two circles I have one solution here https://in.mathworks.com/matlabcentral/fileexchange/4179-draggable which uses the plot function to drag the figures however the only problem is it does not solve and displays the point of intersection of two curves I tried the code on fimplicit but it gives error that X data and y data are read only. If anybody can help me
  댓글 수: 8
Saikat Banerjee
Saikat Banerjee 2020년 7월 17일
can anyone provide an answer for anybody working on this problem
Walter Roberson
Walter Roberson 2020년 7월 17일
I am so backlogged on answering people, that I cannot even find some of the posts that are waiting for responses from me. I have active contributions to over 30 different Questions per day, plus material I read but do not contribute to, plus a heck-load of software upgrades for me this week. I have made it to bed before day once in the past two weeks.

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2020년 7월 17일
Set a ButtonDownFcn callback for each of the graphic objects. The callback should just register which of the objects was selected.
Set a WindowButtonUpFcn callback for the figure. The callback should unregister the last last object, so that no objects would be marked as selected.
Set a WindowButtonMotionFcn callback for the figure. The callback should check to see if any object is marked as active, and if not it should return. If an object is marked as active, then get the Axes CurrentPoint . Now take the XData and YData for the selected graphics object and subtract off the mean x and mean y coordinates, and add the x and y of the CurrentPoint, and set those as being the new XData and YData of the graphics object. This will have the effect of moving the graphics object to be centered around the place the user is pointing to.
Under some circumstance, you will want to trigger detection of potential intersection and calculation of the exact intersection for your purposes. It might perhaps make sense to program that into the WindowButtonUpFcn callback under the circumstance that an object was indeed active.
  댓글 수: 10
Saikat Banerjee
Saikat Banerjee 2020년 7월 19일
then please do not comment further on this post I will ask for help from someone else who would genuinely help me
Walter Roberson
Walter Roberson 2020년 7월 19일
We have different ideas about what is involved to "help" you. The volunteers here mostly believe that the best way to "help" people is to teach them how to do things, rather than for the volunteers to do the work on behalf of the people.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by