Tangent to sphere in a given plane
$begingroup$
I have a sphere centered on the origin $O$. I have a point in space $Cam$ and a vector $Dir$.
How do I find a point $X$ and a Vector Hor where:
- The line starting at Cam and of direction Hor, passing through X, is tangent to the sphere in X
- Hor, Dir and O-Cam are on the same plane
Illustration
And if possible, with the shortest calculation possible. Technically I will be implementing this in a shader, for every given direction I need to find the horizon line on the planet. I tried to abstract the problem as much as possible.
spheres
$endgroup$
add a comment |
$begingroup$
I have a sphere centered on the origin $O$. I have a point in space $Cam$ and a vector $Dir$.
How do I find a point $X$ and a Vector Hor where:
- The line starting at Cam and of direction Hor, passing through X, is tangent to the sphere in X
- Hor, Dir and O-Cam are on the same plane
Illustration
And if possible, with the shortest calculation possible. Technically I will be implementing this in a shader, for every given direction I need to find the horizon line on the planet. I tried to abstract the problem as much as possible.
spheres
$endgroup$
add a comment |
$begingroup$
I have a sphere centered on the origin $O$. I have a point in space $Cam$ and a vector $Dir$.
How do I find a point $X$ and a Vector Hor where:
- The line starting at Cam and of direction Hor, passing through X, is tangent to the sphere in X
- Hor, Dir and O-Cam are on the same plane
Illustration
And if possible, with the shortest calculation possible. Technically I will be implementing this in a shader, for every given direction I need to find the horizon line on the planet. I tried to abstract the problem as much as possible.
spheres
$endgroup$
I have a sphere centered on the origin $O$. I have a point in space $Cam$ and a vector $Dir$.
How do I find a point $X$ and a Vector Hor where:
- The line starting at Cam and of direction Hor, passing through X, is tangent to the sphere in X
- Hor, Dir and O-Cam are on the same plane
Illustration
And if possible, with the shortest calculation possible. Technically I will be implementing this in a shader, for every given direction I need to find the horizon line on the planet. I tried to abstract the problem as much as possible.
spheres
spheres
edited Feb 16 '16 at 19:53
Pichi Wuana
658525
658525
asked Feb 16 '16 at 19:44
blackrackblackrack
62
62
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
You stated that the center of the sphere is the origin of our 3-dimensional space, so suppose we have $O = (0, 0, 0)$, $Cam=(c_x, c_y, c_z)$ and $overrightarrow{Dir}=langle d_x, d_y, d_z rangle$, and that the radius of the sphere is $R$.
Let $X = (r_x, r_y, r_z)$ be what we are solving for.
First, we need to find the plane containing both $Dir$ and $Cam$. Taking the cross product of $overrightarrow{Dir}$ and $overrightarrow{CamO}$, combined with the fact that the plane should contain $O = (0, 0, 0)$, the equation of our plane $P$ is $(c_zd_y - c_yd_z)x + (c_xd_z - c_zd_x)y + (c_yd_x - c_xd_y)z = 0$. We will later use this to ensure our point $X$ is on this plane.
Next, consider the conditions for $X$ to be the point at which $overrightarrow{Hor}$ tangentially contacts the sphere. We need the point $X$ to be on the surface of the sphere, and we need the vectors $overrightarrow{XO}$ and $overrightarrow{XCam}$ to be perpendicular (in order for $overrightarrow{XCam}$ to be tangent to the sphere).
For the first condition, we want $r_x^2 + r_y^2 + r_z^2 = R^2$, simply by substituting the coordinates of $X$ into the equation of our sphere.
For the second condition, we want $overrightarrow{XO} cdot overrightarrow{XCam} = 0$. Since $overrightarrow{XO} = langle -r_x, -r_y, -r_z rangle$ and $overrightarrow{XCam} = langle c_x - r_x, c_y - r_y, c_z - r_z rangle$, we have $overrightarrow{XO} cdot overrightarrow{XCam} = r_x^2 - c_xr_x + r_y^2 - c_yr_y + r_z^2 - c_zr_z = 0$. Note that we can simplify this equation by first substituting $r_x^2 + r_y^2 + r_z^2 = R^2$, and we obtain $c_xr_x + c_yr_y + c_zr_z = R^2$.
Thus, we now have a system of 3 equations and 3 unknowns:
- $(c_zd_y - c_yd_z)r_x + (c_xd_z - c_zd_x)r_y + (c_yd_x - c_xd_y)r_z = 0$
- $r_x^2 + r_y^2 + r_z^2 = R^2$
- $c_xr_x + c_yr_y + c_zr_z = R^2$
Now you can just pick your favorite way to solve it. This will give you the coordinates of $X$, and you will in turn have $overrightarrow{Hor} = overrightarrow{CamX}$. I haven't done the actual substitution yet as it's a huge mess, but I think this answers your question. I'm not exactly sure what you mean by the shortest calculation possible, but I think this method is straightforward and gives you a general expression for the coordinates of $X$ in terms of the parameters you provided.
Hope this helped.
$endgroup$
$begingroup$
Thanks a lot for your response. I tried to solve that system but after a bit of frustration I gave up on it and reformulated the problem as follows: 1) The problem could be assimilated to an intersection of two circles, since we're working in a plane. Once circle centered on the sphere center of radius r, and a second circle centered on Cam of radius (Cam-X) 2) The length of (Cam-X) can be determined from (Cam-O) and the radius of the sphere, taking advantage of the fact that (O-X) and (Cam-X) are perpendicular since X is a tangent. The resulting problem was much easier for me to solve.
$endgroup$
– blackrack
Feb 17 '16 at 3:13
$begingroup$
@blackrack No problem. Indeed, that sounds like a nice way to do it. Was it really easier to solve? I'm envisioning solving for the intersection of two spheres and a plane (also a system of 3 equations), which to me feels like would still take a lot of work to grind through. How did you go about solving it?
$endgroup$
– Brian Yao
Feb 17 '16 at 4:48
$begingroup$
I actually solved for the intersection of 2 circles and used existing circle intersection formulas instead of intersection of 2 spheres and a plane, I'll describe and illustrate my idea shortly.
$endgroup$
– blackrack
Feb 17 '16 at 14:33
add a comment |
$begingroup$
Create a local coordinate system on the plane with the center of the circle as origin, and local x direction along $vec{OC_{am}}$. The 3×3 rotation matrix is
$$ begin{align}
E = & begin{vmatrix} hat{i} & hat{j} & hat{k} end{vmatrix} \
hat{i} &= [ vec{O C_{am}} ] \
hat{k} & = [hat{i} times vec{Dir}] \
hat{j} &= hat{k} times hat{i}
end{align} $$
where the $[vec{v}] = frac{vec{v}}{| vec{v} |}$ notation is for unit vectors, and $times$ is the vector cross product.
Now you take the distance between the center of the circle and point $O_{am}$ along the $hat{i}$ direction as $ell = | vec{O C_{am} } |$
The $(x,y)$ coordinate of the tangent point X on the plane are
$$ (x,y) = left( frac{r^2}{ell}, frac{r sqrt{ell^2-r^2}}{ell} right) $$
where $r$ is the radius of the circle.
The 3D coordinates of X are
$$ vec{X} = frac{r^2}{ell} hat{i} + frac{r sqrt{ell^2-r^2}}{ell} hat{j} $$
The direction of X is $$ vec{H_{or}} = [vec{O_{am} X}] $$
NOTE: The equation of the tangent line on the plane is $left(frac{r}{ell}right)x + left( frac{sqrt{ell^2-r^2}}{ell} right)y = r$.
Example
I have verified the calculation with a GeoGebra model:
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1658672%2ftangent-to-sphere-in-a-given-plane%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
You stated that the center of the sphere is the origin of our 3-dimensional space, so suppose we have $O = (0, 0, 0)$, $Cam=(c_x, c_y, c_z)$ and $overrightarrow{Dir}=langle d_x, d_y, d_z rangle$, and that the radius of the sphere is $R$.
Let $X = (r_x, r_y, r_z)$ be what we are solving for.
First, we need to find the plane containing both $Dir$ and $Cam$. Taking the cross product of $overrightarrow{Dir}$ and $overrightarrow{CamO}$, combined with the fact that the plane should contain $O = (0, 0, 0)$, the equation of our plane $P$ is $(c_zd_y - c_yd_z)x + (c_xd_z - c_zd_x)y + (c_yd_x - c_xd_y)z = 0$. We will later use this to ensure our point $X$ is on this plane.
Next, consider the conditions for $X$ to be the point at which $overrightarrow{Hor}$ tangentially contacts the sphere. We need the point $X$ to be on the surface of the sphere, and we need the vectors $overrightarrow{XO}$ and $overrightarrow{XCam}$ to be perpendicular (in order for $overrightarrow{XCam}$ to be tangent to the sphere).
For the first condition, we want $r_x^2 + r_y^2 + r_z^2 = R^2$, simply by substituting the coordinates of $X$ into the equation of our sphere.
For the second condition, we want $overrightarrow{XO} cdot overrightarrow{XCam} = 0$. Since $overrightarrow{XO} = langle -r_x, -r_y, -r_z rangle$ and $overrightarrow{XCam} = langle c_x - r_x, c_y - r_y, c_z - r_z rangle$, we have $overrightarrow{XO} cdot overrightarrow{XCam} = r_x^2 - c_xr_x + r_y^2 - c_yr_y + r_z^2 - c_zr_z = 0$. Note that we can simplify this equation by first substituting $r_x^2 + r_y^2 + r_z^2 = R^2$, and we obtain $c_xr_x + c_yr_y + c_zr_z = R^2$.
Thus, we now have a system of 3 equations and 3 unknowns:
- $(c_zd_y - c_yd_z)r_x + (c_xd_z - c_zd_x)r_y + (c_yd_x - c_xd_y)r_z = 0$
- $r_x^2 + r_y^2 + r_z^2 = R^2$
- $c_xr_x + c_yr_y + c_zr_z = R^2$
Now you can just pick your favorite way to solve it. This will give you the coordinates of $X$, and you will in turn have $overrightarrow{Hor} = overrightarrow{CamX}$. I haven't done the actual substitution yet as it's a huge mess, but I think this answers your question. I'm not exactly sure what you mean by the shortest calculation possible, but I think this method is straightforward and gives you a general expression for the coordinates of $X$ in terms of the parameters you provided.
Hope this helped.
$endgroup$
$begingroup$
Thanks a lot for your response. I tried to solve that system but after a bit of frustration I gave up on it and reformulated the problem as follows: 1) The problem could be assimilated to an intersection of two circles, since we're working in a plane. Once circle centered on the sphere center of radius r, and a second circle centered on Cam of radius (Cam-X) 2) The length of (Cam-X) can be determined from (Cam-O) and the radius of the sphere, taking advantage of the fact that (O-X) and (Cam-X) are perpendicular since X is a tangent. The resulting problem was much easier for me to solve.
$endgroup$
– blackrack
Feb 17 '16 at 3:13
$begingroup$
@blackrack No problem. Indeed, that sounds like a nice way to do it. Was it really easier to solve? I'm envisioning solving for the intersection of two spheres and a plane (also a system of 3 equations), which to me feels like would still take a lot of work to grind through. How did you go about solving it?
$endgroup$
– Brian Yao
Feb 17 '16 at 4:48
$begingroup$
I actually solved for the intersection of 2 circles and used existing circle intersection formulas instead of intersection of 2 spheres and a plane, I'll describe and illustrate my idea shortly.
$endgroup$
– blackrack
Feb 17 '16 at 14:33
add a comment |
$begingroup$
You stated that the center of the sphere is the origin of our 3-dimensional space, so suppose we have $O = (0, 0, 0)$, $Cam=(c_x, c_y, c_z)$ and $overrightarrow{Dir}=langle d_x, d_y, d_z rangle$, and that the radius of the sphere is $R$.
Let $X = (r_x, r_y, r_z)$ be what we are solving for.
First, we need to find the plane containing both $Dir$ and $Cam$. Taking the cross product of $overrightarrow{Dir}$ and $overrightarrow{CamO}$, combined with the fact that the plane should contain $O = (0, 0, 0)$, the equation of our plane $P$ is $(c_zd_y - c_yd_z)x + (c_xd_z - c_zd_x)y + (c_yd_x - c_xd_y)z = 0$. We will later use this to ensure our point $X$ is on this plane.
Next, consider the conditions for $X$ to be the point at which $overrightarrow{Hor}$ tangentially contacts the sphere. We need the point $X$ to be on the surface of the sphere, and we need the vectors $overrightarrow{XO}$ and $overrightarrow{XCam}$ to be perpendicular (in order for $overrightarrow{XCam}$ to be tangent to the sphere).
For the first condition, we want $r_x^2 + r_y^2 + r_z^2 = R^2$, simply by substituting the coordinates of $X$ into the equation of our sphere.
For the second condition, we want $overrightarrow{XO} cdot overrightarrow{XCam} = 0$. Since $overrightarrow{XO} = langle -r_x, -r_y, -r_z rangle$ and $overrightarrow{XCam} = langle c_x - r_x, c_y - r_y, c_z - r_z rangle$, we have $overrightarrow{XO} cdot overrightarrow{XCam} = r_x^2 - c_xr_x + r_y^2 - c_yr_y + r_z^2 - c_zr_z = 0$. Note that we can simplify this equation by first substituting $r_x^2 + r_y^2 + r_z^2 = R^2$, and we obtain $c_xr_x + c_yr_y + c_zr_z = R^2$.
Thus, we now have a system of 3 equations and 3 unknowns:
- $(c_zd_y - c_yd_z)r_x + (c_xd_z - c_zd_x)r_y + (c_yd_x - c_xd_y)r_z = 0$
- $r_x^2 + r_y^2 + r_z^2 = R^2$
- $c_xr_x + c_yr_y + c_zr_z = R^2$
Now you can just pick your favorite way to solve it. This will give you the coordinates of $X$, and you will in turn have $overrightarrow{Hor} = overrightarrow{CamX}$. I haven't done the actual substitution yet as it's a huge mess, but I think this answers your question. I'm not exactly sure what you mean by the shortest calculation possible, but I think this method is straightforward and gives you a general expression for the coordinates of $X$ in terms of the parameters you provided.
Hope this helped.
$endgroup$
$begingroup$
Thanks a lot for your response. I tried to solve that system but after a bit of frustration I gave up on it and reformulated the problem as follows: 1) The problem could be assimilated to an intersection of two circles, since we're working in a plane. Once circle centered on the sphere center of radius r, and a second circle centered on Cam of radius (Cam-X) 2) The length of (Cam-X) can be determined from (Cam-O) and the radius of the sphere, taking advantage of the fact that (O-X) and (Cam-X) are perpendicular since X is a tangent. The resulting problem was much easier for me to solve.
$endgroup$
– blackrack
Feb 17 '16 at 3:13
$begingroup$
@blackrack No problem. Indeed, that sounds like a nice way to do it. Was it really easier to solve? I'm envisioning solving for the intersection of two spheres and a plane (also a system of 3 equations), which to me feels like would still take a lot of work to grind through. How did you go about solving it?
$endgroup$
– Brian Yao
Feb 17 '16 at 4:48
$begingroup$
I actually solved for the intersection of 2 circles and used existing circle intersection formulas instead of intersection of 2 spheres and a plane, I'll describe and illustrate my idea shortly.
$endgroup$
– blackrack
Feb 17 '16 at 14:33
add a comment |
$begingroup$
You stated that the center of the sphere is the origin of our 3-dimensional space, so suppose we have $O = (0, 0, 0)$, $Cam=(c_x, c_y, c_z)$ and $overrightarrow{Dir}=langle d_x, d_y, d_z rangle$, and that the radius of the sphere is $R$.
Let $X = (r_x, r_y, r_z)$ be what we are solving for.
First, we need to find the plane containing both $Dir$ and $Cam$. Taking the cross product of $overrightarrow{Dir}$ and $overrightarrow{CamO}$, combined with the fact that the plane should contain $O = (0, 0, 0)$, the equation of our plane $P$ is $(c_zd_y - c_yd_z)x + (c_xd_z - c_zd_x)y + (c_yd_x - c_xd_y)z = 0$. We will later use this to ensure our point $X$ is on this plane.
Next, consider the conditions for $X$ to be the point at which $overrightarrow{Hor}$ tangentially contacts the sphere. We need the point $X$ to be on the surface of the sphere, and we need the vectors $overrightarrow{XO}$ and $overrightarrow{XCam}$ to be perpendicular (in order for $overrightarrow{XCam}$ to be tangent to the sphere).
For the first condition, we want $r_x^2 + r_y^2 + r_z^2 = R^2$, simply by substituting the coordinates of $X$ into the equation of our sphere.
For the second condition, we want $overrightarrow{XO} cdot overrightarrow{XCam} = 0$. Since $overrightarrow{XO} = langle -r_x, -r_y, -r_z rangle$ and $overrightarrow{XCam} = langle c_x - r_x, c_y - r_y, c_z - r_z rangle$, we have $overrightarrow{XO} cdot overrightarrow{XCam} = r_x^2 - c_xr_x + r_y^2 - c_yr_y + r_z^2 - c_zr_z = 0$. Note that we can simplify this equation by first substituting $r_x^2 + r_y^2 + r_z^2 = R^2$, and we obtain $c_xr_x + c_yr_y + c_zr_z = R^2$.
Thus, we now have a system of 3 equations and 3 unknowns:
- $(c_zd_y - c_yd_z)r_x + (c_xd_z - c_zd_x)r_y + (c_yd_x - c_xd_y)r_z = 0$
- $r_x^2 + r_y^2 + r_z^2 = R^2$
- $c_xr_x + c_yr_y + c_zr_z = R^2$
Now you can just pick your favorite way to solve it. This will give you the coordinates of $X$, and you will in turn have $overrightarrow{Hor} = overrightarrow{CamX}$. I haven't done the actual substitution yet as it's a huge mess, but I think this answers your question. I'm not exactly sure what you mean by the shortest calculation possible, but I think this method is straightforward and gives you a general expression for the coordinates of $X$ in terms of the parameters you provided.
Hope this helped.
$endgroup$
You stated that the center of the sphere is the origin of our 3-dimensional space, so suppose we have $O = (0, 0, 0)$, $Cam=(c_x, c_y, c_z)$ and $overrightarrow{Dir}=langle d_x, d_y, d_z rangle$, and that the radius of the sphere is $R$.
Let $X = (r_x, r_y, r_z)$ be what we are solving for.
First, we need to find the plane containing both $Dir$ and $Cam$. Taking the cross product of $overrightarrow{Dir}$ and $overrightarrow{CamO}$, combined with the fact that the plane should contain $O = (0, 0, 0)$, the equation of our plane $P$ is $(c_zd_y - c_yd_z)x + (c_xd_z - c_zd_x)y + (c_yd_x - c_xd_y)z = 0$. We will later use this to ensure our point $X$ is on this plane.
Next, consider the conditions for $X$ to be the point at which $overrightarrow{Hor}$ tangentially contacts the sphere. We need the point $X$ to be on the surface of the sphere, and we need the vectors $overrightarrow{XO}$ and $overrightarrow{XCam}$ to be perpendicular (in order for $overrightarrow{XCam}$ to be tangent to the sphere).
For the first condition, we want $r_x^2 + r_y^2 + r_z^2 = R^2$, simply by substituting the coordinates of $X$ into the equation of our sphere.
For the second condition, we want $overrightarrow{XO} cdot overrightarrow{XCam} = 0$. Since $overrightarrow{XO} = langle -r_x, -r_y, -r_z rangle$ and $overrightarrow{XCam} = langle c_x - r_x, c_y - r_y, c_z - r_z rangle$, we have $overrightarrow{XO} cdot overrightarrow{XCam} = r_x^2 - c_xr_x + r_y^2 - c_yr_y + r_z^2 - c_zr_z = 0$. Note that we can simplify this equation by first substituting $r_x^2 + r_y^2 + r_z^2 = R^2$, and we obtain $c_xr_x + c_yr_y + c_zr_z = R^2$.
Thus, we now have a system of 3 equations and 3 unknowns:
- $(c_zd_y - c_yd_z)r_x + (c_xd_z - c_zd_x)r_y + (c_yd_x - c_xd_y)r_z = 0$
- $r_x^2 + r_y^2 + r_z^2 = R^2$
- $c_xr_x + c_yr_y + c_zr_z = R^2$
Now you can just pick your favorite way to solve it. This will give you the coordinates of $X$, and you will in turn have $overrightarrow{Hor} = overrightarrow{CamX}$. I haven't done the actual substitution yet as it's a huge mess, but I think this answers your question. I'm not exactly sure what you mean by the shortest calculation possible, but I think this method is straightforward and gives you a general expression for the coordinates of $X$ in terms of the parameters you provided.
Hope this helped.
answered Feb 16 '16 at 22:11
Brian YaoBrian Yao
533
533
$begingroup$
Thanks a lot for your response. I tried to solve that system but after a bit of frustration I gave up on it and reformulated the problem as follows: 1) The problem could be assimilated to an intersection of two circles, since we're working in a plane. Once circle centered on the sphere center of radius r, and a second circle centered on Cam of radius (Cam-X) 2) The length of (Cam-X) can be determined from (Cam-O) and the radius of the sphere, taking advantage of the fact that (O-X) and (Cam-X) are perpendicular since X is a tangent. The resulting problem was much easier for me to solve.
$endgroup$
– blackrack
Feb 17 '16 at 3:13
$begingroup$
@blackrack No problem. Indeed, that sounds like a nice way to do it. Was it really easier to solve? I'm envisioning solving for the intersection of two spheres and a plane (also a system of 3 equations), which to me feels like would still take a lot of work to grind through. How did you go about solving it?
$endgroup$
– Brian Yao
Feb 17 '16 at 4:48
$begingroup$
I actually solved for the intersection of 2 circles and used existing circle intersection formulas instead of intersection of 2 spheres and a plane, I'll describe and illustrate my idea shortly.
$endgroup$
– blackrack
Feb 17 '16 at 14:33
add a comment |
$begingroup$
Thanks a lot for your response. I tried to solve that system but after a bit of frustration I gave up on it and reformulated the problem as follows: 1) The problem could be assimilated to an intersection of two circles, since we're working in a plane. Once circle centered on the sphere center of radius r, and a second circle centered on Cam of radius (Cam-X) 2) The length of (Cam-X) can be determined from (Cam-O) and the radius of the sphere, taking advantage of the fact that (O-X) and (Cam-X) are perpendicular since X is a tangent. The resulting problem was much easier for me to solve.
$endgroup$
– blackrack
Feb 17 '16 at 3:13
$begingroup$
@blackrack No problem. Indeed, that sounds like a nice way to do it. Was it really easier to solve? I'm envisioning solving for the intersection of two spheres and a plane (also a system of 3 equations), which to me feels like would still take a lot of work to grind through. How did you go about solving it?
$endgroup$
– Brian Yao
Feb 17 '16 at 4:48
$begingroup$
I actually solved for the intersection of 2 circles and used existing circle intersection formulas instead of intersection of 2 spheres and a plane, I'll describe and illustrate my idea shortly.
$endgroup$
– blackrack
Feb 17 '16 at 14:33
$begingroup$
Thanks a lot for your response. I tried to solve that system but after a bit of frustration I gave up on it and reformulated the problem as follows: 1) The problem could be assimilated to an intersection of two circles, since we're working in a plane. Once circle centered on the sphere center of radius r, and a second circle centered on Cam of radius (Cam-X) 2) The length of (Cam-X) can be determined from (Cam-O) and the radius of the sphere, taking advantage of the fact that (O-X) and (Cam-X) are perpendicular since X is a tangent. The resulting problem was much easier for me to solve.
$endgroup$
– blackrack
Feb 17 '16 at 3:13
$begingroup$
Thanks a lot for your response. I tried to solve that system but after a bit of frustration I gave up on it and reformulated the problem as follows: 1) The problem could be assimilated to an intersection of two circles, since we're working in a plane. Once circle centered on the sphere center of radius r, and a second circle centered on Cam of radius (Cam-X) 2) The length of (Cam-X) can be determined from (Cam-O) and the radius of the sphere, taking advantage of the fact that (O-X) and (Cam-X) are perpendicular since X is a tangent. The resulting problem was much easier for me to solve.
$endgroup$
– blackrack
Feb 17 '16 at 3:13
$begingroup$
@blackrack No problem. Indeed, that sounds like a nice way to do it. Was it really easier to solve? I'm envisioning solving for the intersection of two spheres and a plane (also a system of 3 equations), which to me feels like would still take a lot of work to grind through. How did you go about solving it?
$endgroup$
– Brian Yao
Feb 17 '16 at 4:48
$begingroup$
@blackrack No problem. Indeed, that sounds like a nice way to do it. Was it really easier to solve? I'm envisioning solving for the intersection of two spheres and a plane (also a system of 3 equations), which to me feels like would still take a lot of work to grind through. How did you go about solving it?
$endgroup$
– Brian Yao
Feb 17 '16 at 4:48
$begingroup$
I actually solved for the intersection of 2 circles and used existing circle intersection formulas instead of intersection of 2 spheres and a plane, I'll describe and illustrate my idea shortly.
$endgroup$
– blackrack
Feb 17 '16 at 14:33
$begingroup$
I actually solved for the intersection of 2 circles and used existing circle intersection formulas instead of intersection of 2 spheres and a plane, I'll describe and illustrate my idea shortly.
$endgroup$
– blackrack
Feb 17 '16 at 14:33
add a comment |
$begingroup$
Create a local coordinate system on the plane with the center of the circle as origin, and local x direction along $vec{OC_{am}}$. The 3×3 rotation matrix is
$$ begin{align}
E = & begin{vmatrix} hat{i} & hat{j} & hat{k} end{vmatrix} \
hat{i} &= [ vec{O C_{am}} ] \
hat{k} & = [hat{i} times vec{Dir}] \
hat{j} &= hat{k} times hat{i}
end{align} $$
where the $[vec{v}] = frac{vec{v}}{| vec{v} |}$ notation is for unit vectors, and $times$ is the vector cross product.
Now you take the distance between the center of the circle and point $O_{am}$ along the $hat{i}$ direction as $ell = | vec{O C_{am} } |$
The $(x,y)$ coordinate of the tangent point X on the plane are
$$ (x,y) = left( frac{r^2}{ell}, frac{r sqrt{ell^2-r^2}}{ell} right) $$
where $r$ is the radius of the circle.
The 3D coordinates of X are
$$ vec{X} = frac{r^2}{ell} hat{i} + frac{r sqrt{ell^2-r^2}}{ell} hat{j} $$
The direction of X is $$ vec{H_{or}} = [vec{O_{am} X}] $$
NOTE: The equation of the tangent line on the plane is $left(frac{r}{ell}right)x + left( frac{sqrt{ell^2-r^2}}{ell} right)y = r$.
Example
I have verified the calculation with a GeoGebra model:
$endgroup$
add a comment |
$begingroup$
Create a local coordinate system on the plane with the center of the circle as origin, and local x direction along $vec{OC_{am}}$. The 3×3 rotation matrix is
$$ begin{align}
E = & begin{vmatrix} hat{i} & hat{j} & hat{k} end{vmatrix} \
hat{i} &= [ vec{O C_{am}} ] \
hat{k} & = [hat{i} times vec{Dir}] \
hat{j} &= hat{k} times hat{i}
end{align} $$
where the $[vec{v}] = frac{vec{v}}{| vec{v} |}$ notation is for unit vectors, and $times$ is the vector cross product.
Now you take the distance between the center of the circle and point $O_{am}$ along the $hat{i}$ direction as $ell = | vec{O C_{am} } |$
The $(x,y)$ coordinate of the tangent point X on the plane are
$$ (x,y) = left( frac{r^2}{ell}, frac{r sqrt{ell^2-r^2}}{ell} right) $$
where $r$ is the radius of the circle.
The 3D coordinates of X are
$$ vec{X} = frac{r^2}{ell} hat{i} + frac{r sqrt{ell^2-r^2}}{ell} hat{j} $$
The direction of X is $$ vec{H_{or}} = [vec{O_{am} X}] $$
NOTE: The equation of the tangent line on the plane is $left(frac{r}{ell}right)x + left( frac{sqrt{ell^2-r^2}}{ell} right)y = r$.
Example
I have verified the calculation with a GeoGebra model:
$endgroup$
add a comment |
$begingroup$
Create a local coordinate system on the plane with the center of the circle as origin, and local x direction along $vec{OC_{am}}$. The 3×3 rotation matrix is
$$ begin{align}
E = & begin{vmatrix} hat{i} & hat{j} & hat{k} end{vmatrix} \
hat{i} &= [ vec{O C_{am}} ] \
hat{k} & = [hat{i} times vec{Dir}] \
hat{j} &= hat{k} times hat{i}
end{align} $$
where the $[vec{v}] = frac{vec{v}}{| vec{v} |}$ notation is for unit vectors, and $times$ is the vector cross product.
Now you take the distance between the center of the circle and point $O_{am}$ along the $hat{i}$ direction as $ell = | vec{O C_{am} } |$
The $(x,y)$ coordinate of the tangent point X on the plane are
$$ (x,y) = left( frac{r^2}{ell}, frac{r sqrt{ell^2-r^2}}{ell} right) $$
where $r$ is the radius of the circle.
The 3D coordinates of X are
$$ vec{X} = frac{r^2}{ell} hat{i} + frac{r sqrt{ell^2-r^2}}{ell} hat{j} $$
The direction of X is $$ vec{H_{or}} = [vec{O_{am} X}] $$
NOTE: The equation of the tangent line on the plane is $left(frac{r}{ell}right)x + left( frac{sqrt{ell^2-r^2}}{ell} right)y = r$.
Example
I have verified the calculation with a GeoGebra model:
$endgroup$
Create a local coordinate system on the plane with the center of the circle as origin, and local x direction along $vec{OC_{am}}$. The 3×3 rotation matrix is
$$ begin{align}
E = & begin{vmatrix} hat{i} & hat{j} & hat{k} end{vmatrix} \
hat{i} &= [ vec{O C_{am}} ] \
hat{k} & = [hat{i} times vec{Dir}] \
hat{j} &= hat{k} times hat{i}
end{align} $$
where the $[vec{v}] = frac{vec{v}}{| vec{v} |}$ notation is for unit vectors, and $times$ is the vector cross product.
Now you take the distance between the center of the circle and point $O_{am}$ along the $hat{i}$ direction as $ell = | vec{O C_{am} } |$
The $(x,y)$ coordinate of the tangent point X on the plane are
$$ (x,y) = left( frac{r^2}{ell}, frac{r sqrt{ell^2-r^2}}{ell} right) $$
where $r$ is the radius of the circle.
The 3D coordinates of X are
$$ vec{X} = frac{r^2}{ell} hat{i} + frac{r sqrt{ell^2-r^2}}{ell} hat{j} $$
The direction of X is $$ vec{H_{or}} = [vec{O_{am} X}] $$
NOTE: The equation of the tangent line on the plane is $left(frac{r}{ell}right)x + left( frac{sqrt{ell^2-r^2}}{ell} right)y = r$.
Example
I have verified the calculation with a GeoGebra model:
edited Feb 22 '16 at 16:49
answered Feb 22 '16 at 15:44


ja72ja72
7,54212044
7,54212044
add a comment |
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1658672%2ftangent-to-sphere-in-a-given-plane%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown