Optimizing this script without using symbolic toolbox
Mostrar comentarios más antiguos
Hi guys, this is the script which takes up all the time
function [t_sol,xi,yi] = solveIntersection(px,py,rx,ry,r)
syms t
x = px + t*rx;
y = py + t*ry;
c = x^2+y^2-r^2;
t_sol = max(double(solve(c)));
xi = double(subs(x,'t',t_sol));
yi = double(subs(y,'t',t_sol));
This script calculates the intersection of a circle and a given vektor. How do i calculate the intersection without using the symbolic toolbox? Or just how can I optimize this function?
The vector starts in (px,py) and has a direction (rx,ry). r is the radius of the circle.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Conversion Between Symbolic and Numeric en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!