

Let the equation of line is
y = mx + c ...............1
=> y - mx - c = 0 ...........2
Given distance from origin to this line = 2
=> |(0 - 0 - c)/√(1+m2 )| = 2
=> c/√(1+m2 ) = 2
Square on both side, we get
c2 /(1+m2 ) = 4
=> c2 = 4(1+m2 ) ......3
Again given line passes through (2,2)
So 2 - 2m - c = 0
= > c = 2-2m ..........4
Put this value in equation3, we get
(2 - 2m)2 = 4(1+m2 )
=> 4 + 4m2 - 8m = 4 + 4m2
=> 8m = 0
=> m = 0
Put this value in equation 4 , we get
c= 2 - 0
=> c = 2
Now Put this value of c and m in equation 1 , we get
y = 0*x + 2
=> y = 2
This is the required equation of line.
