kuroneko

kuroneko

The Ray Tracer Challenge: Rational Form inverses (pg 39-41)

Whilst the author has been careful to provide exact results for the tests elsewhere in the book (such as surds with the transformation tests), and indirectly provided them for the first of the tests, the second and third inverse tests are missing rational form expected results.

These can be trivially produced using Wolfram Alpha, but for the two tests on page 41:

For A = 
|  8 -5  9  2 |
|  7  5  6  1 |
| -6  0  9  6 |
| -3  0 -9 -4 |

The rational-form inverse is:

| -30  -30  -55 -105 |
| -15   24    5    6 |
|  70   70   85  180 | * 1/195
| 135 -135 -150 -375 |


For A = 
|  9  3  0  9 |
| -5 -2 -6 -3 |
| -4  9  6  4 |
| -7  6  6  2 |

The rational-form inverse is:
|  -66 -126  234 -360 |
| -126   54  594 -540 |
|  -47 -237 -177  210 | *  1/1620;
|  288  108 -432  540 |

Using the above you can match the tests to whatever final precision your code is operating in.

Popular Pragmatic Bookshelf topics Top

Razor54672
The answer to 3rd Problem of Chapter 5 (Making Choices) of “Practical Programming, Third Edition” seems incorrect in the given answer ke...
New
johnp
Hi Brian, Looks like the api for tinydb has changed a little. Noticed while working on chapter 7 that the .purge() call to the db throws...
New
yulkin
your book suggests to use Image.toByteData() to convert image to bytes, however I get the following error: "the getter ‘toByteData’ isn’t...
New
herminiotorres
Hi! I know not the intentions behind this narrative when called, on page XI: mount() |> handle_event() |> render() but the correc...
New
Chrichton
Dear Sophie. I tried to do the “Authorization” exercise and have two questions: When trying to plug in an email-service, I found the ...
New
swlaschin
The book has the same “Problem space/Solution space” diagram on page 18 as is on page 17. The correct Problem/Solution space diagrams ar...
New
fynn
This is as much a suggestion as a question, as a note for others. Locally the SGP30 wasn’t available, so I ordered a SGP40. On page 53, ...
New
s2k
Hi all, currently I wonder how the Tailwind colours work (or don’t work). For example, in app/views/layouts/application.html.erb I have...
New
dtonhofer
@parrt In the context of Chapter 4.3, the grammar Java.g4, meant to parse Java 6 compilation units, no longer passes ANTLR (currently 4....
New
roadbike
From page 13: On Python 3.7, you can install the libraries with pip by running these commands inside a Python venv using Visual Studio ...
New

Other popular topics Top

AstonJ
SpaceVim seems to be gaining in features and popularity and I just wondered how it compares with SpaceMacs in 2020 - anyone have any thou...
New
New
New
New
Exadra37
I am a Linux user since 2012, more or less, and I always use Ubuntu on my computers, and my last 2 laptops have been used Thinkpads, wher...
New
Rainer
Not sure if following fits exactly this thread, or if we should have a hobby thread… For many years I’m designing and building model air...
New
AstonJ
In case anyone else is wondering why Ruby 3 doesn’t show when you do asdf list-all ruby :man_facepalming: do this first: asdf plugin-upd...
New
wmnnd
Here’s the story how one of the world’s first production deployments of LiveView came to be - and how trying to improve it almost caused ...
New
PragmaticBookshelf
Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
New
New