Below is some code where I divide some numbers (transformerFromPDFToMk.tx
, transformerFromPDFToMk.ty
) by a scale.
for node in scene.rootNode.childNodes {
node.position = SCNVector3Make(-Float(transformerFromPDFToMk.tx) / scale + node.position.x, node.position.y, -Float(transformerFromPDFToMk.ty) / scale + node.position.z)
...
}
The scale
is this number output in the console:
Optional(2127.32227)
and the tx/ty
values are:
81145541.6402883 -- tx
99399613.5798074 -- ty
After the division the number only has one decimal place:
38144.5 --- node position after init: x
46725.2 --- node position after init: y
I was wondering if I could keep the precision of the two numbers being divided, in the answer, after dividing them.