Rofrdintrusion
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analytical Geometry
Introduced first in SolidGeometry 5.0, Creation date: 2021-02-20, Last change: 2025-09-15
provides the minimum intrusion distance to fully insert a cylinder into a sphere
Description
Better name would be Rofarcchord:
a=atan(d/r);
R=d/(1-cos(2*a))
See Also: sofrd
, dofRintrusion
, rofRintrusion
, PLchordof2PR
Example Illustration
Syntax
R=Rofrdintrusion([d,r])
Input Parameter
d: | | distance between chord and Radius R |
r: | | radius of the chord |
Output Parameter
R: | | Radius of a circle with chordlength 2*r and d between chord and R |
Examples
Rofrdintrusion(5,13.2288)
Copyright 2021-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
This function, Rofrdintrusion, calculates the minimum intrusion distance required to fully insert a cylinder into a sphere. It is part of the SolidGeometry library and was introduced in version 5.0.
Input Parameters
- d: The distance between the chord and the radius
R.
- r: The radius of the chord.
Output
- R: The radius of a circle with a chord length of
2*r and a distance d between the chord and R.
Algorithm Steps
- Retrieve the input parameters
d and r using the getfuncparams function. Default values are 3 for d and 10 for r if not provided.
- Calculate the angle
a using the formula a = atan(d/r).
- Compute the radius
R using the formula R = d / (1 - cos(2*a)).
- If no output is requested (
nargout == 0), visualize the result using plotting functions:
- Plot a circle with radius
R using CPLplot.
- Plot the chord and its position using
lplot.
- Annotate the plot with the calculated values of
R, d, and r.
Example
To calculate the radius R for a chord with a distance d = 5 and radius r = 13.2288, use:
Rofrdintrusion(5, 13.2288)
Algorithm explaination created using ChatGPT on 2025-08-19 01:19. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21