# Question:Convert calculated floats to rational numbers / or fractions - Example via Given Rotation

## Question:Convert calculated floats to rational numbers / or fractions - Example via Given Rotation

Maple

Hello

I have a question respective to the display of calculated numbers.

Is there a way to display the "correct" value of a calculated float or absurd fraction?

I tried it with evalf(), convert(rational) but without success.

To be concrete I calculate the Given Rotation matrices of

`A := Matrix(3, 3, [[-3, 32/5, 4], [4, 24/5, 3], [5, 6*sqrt(2), 5*sqrt(2)]])`

in the first Step I eliminate the second entry of the first row

with following given rotation (calculated with pen&paper)

`G := Matrix(3, 3, [[-3/5, 4/5, 0], [-4/5, -3/5, 0], [0, 0, 1]])`

which results in the followin (correct) matrix

Matrix(3, 3, {(1, 1) = 5, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = -8, (2, 3) = -5, (3, 1) = 5, (3, 2) = 6*2^(1/2), (3, 3) = 5*2^(1/2)})

But using the method

`Given1 := GivensRotationMatrix(A[1], 1, 2);`

I get following weird approximated matrix

Matrix(3, 3, [[-(15/1249)*sqrt(1249), (32/1249)*sqrt(1249), 0], [-(32/1249)*sqrt(1249), -(15/1249)*sqrt(1249), 0], [0, 0, 1]])

Just look at the the cell a11 which should be -3/5 but with GivensRotationmatrix() I get this totaly

weird fraction -15*sqrt(1249)*(1/1249). I tried simpliefed, evalf, convert(ration) but never get the result of -3/5.

Maybe someone can help me? :)

EDIT

Writing maple code in this editor is a pain in the ass.

Isnt "Maple Math" wortking?!

﻿