Skip to main content

A Basic Course in Spatial Analytic Geometry

  • Chapter
Fast Algorithms for 3D-Graphics
  • 151 Accesses

Abstract

In this chapter, we deal with the most common problems of analytic geometry and present possible solutions for them. We also include an introduction to pointer arithmetic for programmers with little experience, so that they may be able to understand more complex things later on.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. “American National Standard Institute.”

    Google Scholar 

  2. register variables speed up the code. They axe just a suggestion, however, and whether the program really profits from them depends on the compiler that is used.

    Google Scholar 

  3. The reason why we use so many macros is explained in Appendix B.2.

    Google Scholar 

  4. One should always pass the address of a structure (“pass by reference”) and not the structure itself (“pass by value”). A pass by value passes an entire copy of the structure. A pass by value guarantees that the function does not change the structure being passed!

    Google Scholar 

  5. A Vector is by definition an array, i.e., an address. This is different from PASCAL: if you pass an array in PASCAL, the program makes a copy of the entire array unless you use the keyword var!

    Google Scholar 

  6. In fact, this is only true when the light rays are parallel. Otherwise the angle of incidence will be different for each point of the face. An “average angle of incidence” might be the angle of incidence of the light ray through the barycenter of the polygon. This point can be precalculated before any drawings are begun.

    Google Scholar 

  7. In C no type Bool is denned. The smallest fast-accessible type of a variable is char, which can still be assigned to the values 128 to +127. There will be no warning if you assign an arbitrary number to a Bool variable. Nevertheless, we will only assign TRUE and FALSE. These two values have to be (re)defined. For less experienced C programmers: if we want to have the variables lambda and parallel at our disposal outside the function, we have to pass them as pointer variables, because C “calls by value” (in PASCAL you would have to write the keyword var before the variable in the argument list). A pointer variable ptr to a float, for example, is declared by float *ptr. The pointer ptr itself is then the address of the variable *ptr. The pointer can only be changed within a function, whereas a change of its contents *ptr will also be effective outside of it! When calculating lambda, we had to make sure that there was no division by zero. It will occur when the direction of the line is parallel to the plane. In this case, A is oo or it is not defined, if the point on the line coincides with the plane. If we now let λ = INFINITE or λ = 0, the “intersection point” will be somewhere far out on the line or it will be the initial point itself, which is fine. Computer scientists prefer unconventional solutions like this one, rather than having to distinguish between several different cases. The flag parallel is set additionally in order to let us know when a special case has occurred.

    Google Scholar 

  8. This gives us the chance to explain the different writings we can use when we pass an array x as a function argument. The compiler will convert your writing into the pointer *x in any case. Thus, it does not make any difference whether you really pass a pointer or the start address of an array. For better reading, however, it is preferable to write x[] or, when the size of the array is constant, x[stze]. The compiler uses the size information only for bounds-checking (provided that it supports that feature).

    Google Scholar 

  9. For less experienced C programmers: we have to pass the argument plane2 as a pointer to a Plane. This is done by passing its address (= b, plane2).

    Google Scholar 

  10. C is very flexible in the declaration of variables. Sometimes programs become more readable when variables that are needed only in smaller loops etc., are declared locally. Such variables, however, cannot be used as register variables.

    Google Scholar 

  11. *vec is a Vector, i.e., a pointer to a float, **vec is a float!

    Google Scholar 

  12. The type Rot_matrix is by definition a pointer. Therefore, the changes of the argument c will be valid outside the function.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 1994 Springer Science+Business Media New York

About this chapter

Cite this chapter

Glaeser, G. (1994). A Basic Course in Spatial Analytic Geometry. In: Fast Algorithms for 3D-Graphics. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-662-25798-2_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-662-25798-2_1

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-94288-7

  • Online ISBN: 978-3-662-25798-2

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics