Slab method: Difference between revisions

Content deleted Content added
Fixing harv/sfn error. Please watchlist Category:Harv and Sfn no-target errors and install User:Trappist the monk/HarvErrors.js to help you spot such errors when reading and editing.
m fixed lint errors – obsolete center HTML tags
Line 50:
</math>
 
While the equations above are well defined for [[real number|real-valued]] variables only if <math>r_i \ne 0 \; \forall i</math>, i.e. if the ray is not parallel to any of the coordinate axes, the algorithm can be applied to an [[Extended real number line|extended real number]] arithmetic (such as the one implemented by [[IEEE 754]]) to handle rays parallel to an axis, as long as the origin of the ray itself does not lie on one of the faces of the bounding box. In such arithmetic, the intersections with the planes parallel to the ray will be given by <math>t = +\infty</math> or <math>t = -\infty</math>, and the algorithm will still work as expected. If the origin lies on a face of the bounding box, then for some <math>i</math> it will happen that <math>t_i = \frac{0}{0}</math>, which is undefined (in IEEE 754 it is represented by [[NaN]]). However, implementations of the [[IEEE 754-2008 revision|IEEE 754-2008]] <tt>{{mono|minNum</tt>}} and <tt>{{mono|maxNum</tt>}} functions<ref>For example, <tt>{{mono|fmin</tt>}} and <tt>{{mono|fmax</tt>}} in [[C99]].</ref> will treat NaN as a missing value, and when comparing a well-defined value with a NaN they will always return the well-defined value,{{sfn|IEEE Standards Committee|2008}} and they will therefore be able to handle even such corner case. An alternative approach to handle corner cases is to avoid divisions by zero altogether, which can be achieved by replacing the inverse of zero with a large arbitrary constant number.{{sfn|Kay|Kajiya|1986|p=273}}
 
== References ==