A new computational method of obtaining optical constants from reflectance ratio measurements