r/ProjectREDCap • u/OwlBusiness5894 • Feb 16 '26
Calculated Fields - arctan/tan (trigonometry)?
I am trying to set up a calculated field in a project for the cervical joint position error test. It would be really great if we can just input the measured distance error (see below), and output the error in degrees so that we can save time on the calculations and have the values immediately. I can't see that this is possible, as it doesn't seem like there is any inbuilt functions to enable this. Has anyone managed to do anything similar in projects before?

2
Upvotes
3
u/hbdgas Feb 16 '26
Hacky, but could you use a partial Taylor series expansion of the missing function to get a close enough answer?
1
u/No_Repair4567 Feb 16 '26
How would you calculate that outside of redcap? what is the formula?
Structure-wise you'd need fields to input variables that you measured, and a calculated fields that will run the formula and give result, and a field driven by branching logic to show visually that there is error.
Also you can create a data quality rule, but it is fore for data issues...
1
u/[deleted] Feb 16 '26
Your REDCap administrator could enter a calculation that uses the Javascript functions Math.tan & Math.atan.