This is a macro which has a few customizable numbers to allow for usage on several fronts.
the macro:
/script local a,b,c,d,e = UnitArmor("player"); local x = 80; local y = 1; ChatFrame1:AddMessage(format("My armor is %i (%.2f%% DR)", b, 100*(1-y*(1-b/(85*(x+4.5*(x-59))+400)/(1+b/(85*(x+4.5*(x-59))+400))))))
when run, it'll look something like this in your main chatframe:
My armor is 30267 (66.52% DR)
now for the customization points:
local x = 80
is the target level, which means you let it stay at 80 for lvl 80 mobs, 81-82 for heroic mobs/raid trash/heroic bosses or 83 for raid bosses/non-trivial adds/non-trivial trash
local y = 1
is a coefficient for other class/gear damage reductions, just multiply all coefficients that you wish to include
i made a list of the ones i could think of, including cooldowns:
Warrior Coefficients
Defensive Stance: 0.9 (10% damage reduction)
Shield Wall (non-glyphed): 0.4 (60% damage reduction)
Shield Wall (glyphed): 0.6 (40% damage reduction)
Druid Coefficients
Protector of the Pack: 0.88 (12% damage reduction)
T10 4pc set bonus (proc): 0.88 (12% damage reduction)
Barkskin: 0.8 (20% damage reduction)
Paladin Coefficients
Divine Protection: 0.5 (50% damage reduction)
Shield of the Templar: 0.97 (3% damage reduction)
Blessing of Sanctuary: 0.97 (3% damage reduction)
Glyph of Divine Plea: 0.97 (3% damage reduction)
Improved Righteous Fury: 0.94 (6% damage reduction)
Death Knight Coefficients
Frost Presence: 0.92 (8% damage reduction)
Frost Presence (Improved): 0.9 (10% damage reduction)
Blade Barrier (proc): 0.95 (5% damage reduction)
Will of the Necropolis (proc): 0.95 (5% damage reduction)
Bone Shield (unholy, limited): 0.8 (20% damage reduction)
Icebound Fortitude: 0.5 (50% damage reduction typical for 540 defense, scales at 0.15% DR per point of defense skill, not rating)
mathy IBF: 0.7-(Defense-400)*0.0015 (30% base damage reduction, 0.15% per defense skill over 400. 0.0015 is because 1.0 = 100%, so 0.0015 = 0.15%)
Army of the Dead (Channel): 1-(dodge+parry)/100 (sum of dodge and parry chances = damage reduction)
T10 4pc set bonus (proc): 0.88 (12% damage reduction)
examples:
pally with both talents and both blessings:
local y=0.94*0.97*0.97*0.97
Frost DK with 580 defense and 50% dodge+parry popping pc T10+IBF+army while Blade Barrier is running:
local y= 0.9*0.95*(0.7-180*0.0015)*0.88*0.5