Is calling trig functions each frame expensive?

I am rotating a Door component which has a Knob component attached to it. I want to move the Player so they are always in front of the Knob. My current solution is:

//   Called every frame the Player is interacting with the Door
    
float DoorYaw = (DoorRotation.Yaw + 180) * (PI / 180);
float DeltaX = cosf(FrameRotation) * DistFromKnob;
float DeltaY = sinf(FrameRotation) * DistFromKnob;
float FrameYaw = DoorFrameYaw + 180;
KnobLocation = Doorknob->GetComponentLocation();
    
//   and then move the Player to KnobLocation +/- (DeltaX, DeltaY) depending on what side the Player is from the Door.

I feel like this solution is too complex and a better solution is:

For a better solution, I am trying to get the change in position of the Knob from the last frame so that I can apply the same position change to the player to get a similar effect, but when I do this, the player only moves in a tiny circle copying the door rotation. Does anyone have any tips?!

Would the Player’s movement path not be what I have in the diagram above?

Thanks.

I forgot to include that I am adding 180 to the rotations so that I am working with 0 - 360 degrees instead of -180 - 180 degrees.

It does not looks expensive to me if you had a hell lot more floating point operation actor or have collision check then maybe, you need to remember that all actors move by tick operations.

If you worried you can measure that yourself with new Insights tool (well time stat system is there since beginning, this new tool simply shows it’s data a lot nicer), which video about it here:

All you need to cover code your want to messure with this:
TRACE_CPUPROFILER_EVENT_SCOPE(NameGoesHere) {

      //code you want to measure execution time

}

remember to run editor with -cpuprofilertrace option or else it wont sed data to the tool and you will see empty timeline graph. You also probably will need to zoom in a lot to see it, if you dont noise it then that means you code is like butter for your CPU, also if it’s at 100μs is on edge if time precision

Also don’t execute this code then player does not interact with the door, it like most basic optimization you can do

Thank you for the feedback and tips!!!