This script calculates templates for truncated conical transitions for rocket airframes. You input d1 and d2 as the end diameters matching the rocket airframe dimensions and you input the desired length. The function returns two radii, R1 and R2 and an angle, Theta, with which you can create a template.
import math def transition(): d1=float(input("enter first diameter in mm ")) d2=float(input("enter second diameter in mm ")) l=float(input("enter length in mm ")) y=float(((d1-d2)/2)) sinD=float((1/(math.sqrt(((l/y)**2)+1)))) sinT=round(float(360*sinD),3) r1=round(float(d1/(2*sinD)),3) r2=round(float(d2/(2*sinD)),3) print("r1 is ",r1, "mm") print("r2 is ",r2, "mm") print("Theta is", sinT, "degrees")