When the axis is oblique then inclination with axis is given by tanθ=msinω1+mcosω
For y=mx+c
tanθ1=msinω1+mcosω......(i)
For my+x=d
my=−x+d
y=−1mx+dmtanθ2=−1msinω1+(−1m)cosω=−sinωm−cosω......(ii)
As you know, angle between the lines is the difference between the angle that they make with their axis.
tan(θ1−θ2)=tanθ1−tanθ21+tanθ1tanθ2
Substituting (i) and (ii)
tan(θ1−θ2)=msinω1+mcosω−(−sinωm−cosω)1+(msinω1+mcosω)(−sinωm−cosω)tan(θ1−θ2)=m2sinω−msinωcosω+sinω+msinωcosωm−cosω+m2cosω−mcos2ω−msin2ωtan(θ1−θ2)=(m2+1)sinω(m2−1)cosω+m−m(cos2ω+sin2ω)tan(θ1−θ2)=(m2+1)sinω(m2−1)cosωθ1−θ2=tan−1((m2+1)sinω(m2−1)cosω)