How to rotate snippet in 3D space?

I m developing a shooter. Vector EA is my sight view (Camera view direction). Vector DB is a line of the barrel and point B is a muzzle. Of course, the player “moves” the vector EA in different directions and moreover there is a leaning at the left and at the right. Let’s assume E’A’ is the new position of the EA in the space. And D’B’ is a new position of DB respectively.

I am doing all calculation with aid of sin and cos. Could someone provide a code how to use FRotationMatrix or any other specific UE lib functions?

  1. How can I get D’B’ (rotator or vector) from E’A’ (rotator) if I know angle BDC?

  2. How can I get D’B’ (rotator or vector) from E’A’ (rotator) if I know angle BDC, and distance between AB (FVector).

  3. How can I get D’B’ (rotator or vector) from E’A’ (rotator) if I know angle BDC, distance between AB (FVector), and ange of lean accordingly to EA line (EA will be always EA despite of amount of the angle).

FRotator SightLine; // direction of vector EA
FRotator BarrelAngle; // BarrelAngle.Pitch = angle BDC
FVector MuzzleShift; // MuzzleShift.Z = AB
FRotator LeanAngle; // LeanAngle.Roll = lean angle

I did what I wanted in very simple way.

I have added two SceneComponents and former attached to Camera as a child. and later attached to the former as a Child.

Former is SightLine, later is a MuzzleLine:

UPROPERTY(VisibleAnywhere,BlueprintReadOnly,Category="Shooting", meta = (AllowPrivateAccess = "true"))
	TObjectPtr<class USceneComponent> SightLine;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Shooting", meta = (AllowPrivateAccess = "true"))
	TObjectPtr<class USceneComponent> MuzzleLine;

and then I have created them in the constructor and applied MuzzleOffset (AB distance):

	SightLine = CreateDefaultSubobject<USceneComponent>(TEXT("Sight Line"));
	SightLine->SetupAttachment(FPSCameraComponent);

	MuzzleLine = CreateDefaultSubobject<USceneComponent>(TEXT("Muzzle Line"));
	MuzzleLine->SetupAttachment(SightLine);
	MuzzleLine->SetRelativeLocation(MuzzleOffset);

then I set angle BDC:

MuzzleLine->SetRelativeRotation(
				FRotator(
					RearSightLeaf.IsValidIndex(CurrDistIdx) ? RearSightLeaf[CurrDistIdx].Ld : 0.f
					, 0.f
					, 0.f
			));

When I rotate a camera my SightLine is becoming E’A’.

When I need position and rotation of the D’B’ I m getting component’s transform:

FRotator rotator = MuzzleLine->GetComponentRotation();
FVector location = MuzzleLine->GetComponentLocation();

And if I need to lean the plain about the line E’A’ I m applying relative rotation to the SightLine:

SightLine->SetRelativeRotation(FRotator(0.f, 0.f, LeanRoll));

And UE preforms all necessary calculations. But I still want to know how to do all this transformations just applying functions. Obviously they exist somewhere inside of UE, could someone provide the list of these functions/methods?