Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
cyclic quadrilateral solution in Clear category for Strawberry Fields by ogoro
from math import acos, pi
def strawberryfield(a, b, c, d):
b, d = d, b
# angle of cyclic quadrilateral:
# https://en.wikipedia.org/wiki/Cyclic_quadrilateral#Angle_formulas
alpha_cosine = (a ** 2 + b ** 2 - c ** 2 - d ** 2) / 2 / (a * b + c * d)
alpha_radians = acos(alpha_cosine)
alpha_degrees = alpha_radians / pi * 180
rounded_alpha = round(alpha_degrees, 1)
return rounded_alpha
April 4, 2021
Comments: