I need help with solving Triangle SAS [“Side, Angle, Side”]

It use cos

https://www.mathsisfun.com/algebra/trig-solving-sas-triangles.html

a2 = b2 + c2 − 2bc cosA

Example:

Angle A = 49°

Side b = 5

Side c = 7

a2 = 52 + 72 − 2 × 5 × 7 × cos(49°)

a2 = 25 + 49 − 70 × cos(49°)

a2 = 74 − 70 × 0,6560…

a2 = 74 − 45,924… = 28,075…

a = √28,075…

a = 5,298…

a = 5,30

So result

Side a is 5,3

Side b is 5

Side c is 7

So i need help with code to i can get this work

with

Side b is variable

Side c is variable

Angle A is variable

Please help