Socket is on the
Lamp type
Top-down plan of a room with a wall socket and a lamp that can be dragged, drawn to scale, with the cord route shown along the wall

The plan is drawn to scale. The solid line is the tidy route: straight to the nearest point of the socket's wall, then along the skirting. The dashed line is the shortcut across the floor. The cord needed includes the climb down from a table, the climb up to the socket and 20 cm of slack.

Drag the lamp, or focus it and press the arrow keys. The green route means the cord reaches, terracotta means it is short.