5 messages in com.googlegroups.sketchuprubyRe: floating point precision
FromSent OnAttachments
bve...@gmail.com20 Jan 2008 21:01 
Todd Burch - Katy, Texas21 Jan 2008 04:48 
bve...@gmail.com21 Jan 2008 13:47 
Todd Burch - Katy, Texas21 Jan 2008 14:45 
Francis22 Jan 2008 09:28 
Subject:Re: floating point precision
From:bve...@gmail.com (bve@gmail.com)
Date:01/21/2008 01:47:28 PM
List:com.googlegroups.sketchupruby

how can i replicate it?

On Jan 21, 7:49 am, Todd Burch - Katy, Texas wrote:

It's most likely just floating point precision rounding.

Todd

On Jan 20, 11:01 pm, "[email address]" wrote:

I'm trying to understand the transformation class. i wrote an observer to display the transformation array whenever the entity changed. so i created a cube and made it into a component and added my observer to it. to start with, it looks like this (i also overloaded the to_s function for transform)

[1.0, 0.0, 0.0, 0.0] [0.0, 1.0, 0.0, 0.0] [0.0, 0.0, 1.0, 0.0] [0.0,0.0, 0.0, 1.0]

however after rotating +90 degrees and then back to its original the matrix looks like this [1.0, 0.0, 0.0, 0.0] [0.0, 1.0, 0.0, 0.0] [0.0, 0.0, 1.0, 0.0] [6.48592290986016e-013,-6.7562622163564e-013, 0.0, 1.0]

the numbers are really tiny. so minuscule that it would never affect calculations significantly but if i use transformation.origin i get "Point3d(0, 0, 0)"

furthermore "ss.transformation.origin.x" yields 6.48592290986016e-013

so my first question, in a long list of questions, how does it know?