Why make something complicated when it can be staggeringly simple - no sums are needed.
- When on final look at your DI/HSI and find the reported wind direction round the outside of it.
- Mentally drop a line from the wind direction until it hits the horizontal centre line.
- The proportion of the centre line between this intersection and the centre is the proportion of the reported wind that's across the runway.
(As originally described a bit earlier by low n' slow)
If you do the same thing horizontally you get the headwind.
This is as accurate as you want to make it and takes about 2 seconds.
HFD
(BTW, if you want to know what the components are before you reach final just turn another compass rose (RBI/CDI?) to the runway track and use that)