A computer-implemented method of determining trajectories for a plurality of primary wells while avoiding collision between wells, the method comprising: determining a zone of uncertainty for individual wells of the plurality of wells, whereby a plurality of zones of uncertainty are determined; determining, based on the plurality of zones of uncertainty, a minimum separation factor for an offset well at location (0,0) and individual wells of the plurality of primary wells at location (x, y), whereby a plurality of minimum separation factors is determined according to: Osf = x 2 + y 2 B p k 2 + C p k + A p 1 + k 2 + B o k 2 + C o k + A o 1 + k 2 where: A o = a 2 2 cos 2 α + b 2 2 sin 2 α, B o = a 2 2 sin 2 α + b 2 2 cos 2 α, C o = 2 cos α sin α a 2 2 − b 2 2, A p = a 1 2 cos 2 β + b 1 2 sin 2 β, B p = a 1 2 sin 2 β + b 1 2 cos 2 β C p = 2 cos β sin β a 1 2 − b 1 2, k = y x, α is the angle between the semi-major axis of the primary well and the positive x-axis direction, β is the angle between the semi-major axis of the offset well and the positive x-axis direction, a 1 is the length of the semi-major axis, b 1 is the length of the semi-minor axis of the ellipse of uncertainty for the offset well, a 2 is the length of the semi-major axis and b 2 is the length of the semi-minor axis, of the ellipse of uncertainty for the primary well; determining, based on at least one zone of uncertainty of the plurality of zones of uncertainty, a gradient of a separation factor for at least one pair of wells of the plurality of pairs of wells, whereby at least one separation factor gradient ∂ SF ∂ x ∂ SF ∂ y is determined at a point (x, y) in the horizontal plane as: ∂ OSF ∂ x = 2 x M p + M o − x 2 + y 2 M p + M o 2 C p y + 2 A p x 2 M p + C o y + 2 A o x 2 M o ∂ OSF ∂ y = 2 y M p + M o − x 2 + y 2 M p + M o 2 2 B p y + C p x 2 M p + 2 B o y + C o x 2 M o where M p = A p x 2 + C p xy + B p y 2, and M o = A o x 2 + C o xy + B o y 2; updating a nudge position for at least one well, based on at least one of the at least one separation factor gradient and based on at least one minimum separation factor of the plurality of separation factors; and providing, based on the updating, nudge positions for the individual wells of the plurality of wells. determining a zone of uncertainty for individual wells of the plurality of wells, whereby a plurality of zones of uncertainty are determined; determining, based on the plurality of zones of uncertainty, a minimum separation factor for an offset well at location (0,0) and individual wells of the plurality of primary wells at location (x, y), whereby a plurality of minimum separation factors is determined according to: Osf = x 2 + y 2 B p k 2 + C p k + A p 1 + k 2 + B o k 2 + C o k + A o 1 + k 2 where: A o = a 2 2 cos 2 α + b 2 2 sin 2 α, B o = a 2 2 sin 2 α + b 2 2 cos 2 α, C o = 2 cos α sin α a 2 2 − b 2 2, A p = a 1 2 cos 2 β + b 1 2 sin 2 β, B p = a 1 2 sin 2 β + b 1 2 cos 2 β C p = 2 cos β sin β a 1 2 − b 1 2, k = y x, α is the angle between the semi-major axis of the primary well and the positive x-axis direction, β is the angle between the semi-major axis of the offset well and the positive x-axis direction, a 1 is the length of the semi-major axis, b 1 is the length of the semi-minor axis of the ellipse of uncertainty for the offset well, a 2 is the length of the semi-major axis and b 2 is the length of the semi-minor axis, of the ellipse of uncertainty for the primary well; determining, based on at least one zone of uncertainty of the plurality of zones of uncertainty, a gradient of a separation factor for at least one pair of wells of the plurality of pairs of wells, whereby at least one separation factor gradient ∂ SF ∂ x ∂ SF ∂ y is determined at a point (x, y) in the horizontal plane as: ∂ OSF ∂ x = 2 x M p + M o − x 2 + y 2 M p + M o 2 C p y + 2 A p x 2 M p + C o y + 2 A o x 2 M o ∂ OSF ∂ y = 2 y M p + M o − x 2 + y 2 M p + M o 2 2 B p y + C p x 2 M p + 2 B o y + C o x 2 M o where M p = A p x 2 + C p xy + B p y 2, and M o = A o x 2 + C o xy + B o y 2; updating a nudge position for at least one well, based on at least one of the at least one separation factor gradient and based on at least one minimum separation factor of the plurality of separation factors; and providing, based on the updating, nudge positions for the individual wells of the plurality of wells.