Calculating sphere parameters