# How to 3D-plot with specific ranges?

I have the following function which I want to plot using Plot3D:

(-1 + w + 3 s w)/(2 (-1 + w + 4 s w))


, which is only meaningful for the defined ranges:

(1/4 < s <= 1/2 && 1/(4 s) < w <= 1) || (s > 1/2 &&
3/(2 + 8 s) < w <= 1)


Is it possible to plot fx like this:

Plot3D[(-1 + w + 3 s w)/(2 (-1 + w + 4 s w)), {s, 0, 3}, {w, 0, 1}]


using the defined ranges instead of numbers?

Does it even make sense to do so?

The current output with the example above looks like this:

• Do you have V10? Plot3D[(-1 + w + 3 s w)/(2 (-1 + w + 4 s w)), {s, w} \[Element] ImplicitRegion[(1/4 < s <= 1/2 && 1/(4 s) < w <= 1) || (s > 1/2 && 3/(2 + 8 s) < w <= 1), {s, w}]] – Kuba Jun 27 '16 at 12:58
• I am not familiar with V10. – Saud Jun 27 '16 at 13:04
• RegionFunction[] was introduced in v6.0, @Sumit 's answer should work. – Feyre Jun 27 '16 at 13:05
• I meant version number. – Kuba Jun 27 '16 at 13:05

You can use RegionFunction to specify the range.
Plot3D[(-1 + w + 3 s w)/(2 (-1 + w + 4 s w)), {s, 0, 3}, {w, 0, 1},

• @Saud, because RegionFunction expects a function of three variables, even if you only need two for this example. – J. M. will be back soon Jun 27 '16 at 13:22