No, this is neither a wide angle nor a, "Fish-eye," lens. On your D40 this will work as a slight telephoto lens with almost perfectly rectalinear lines (straight lines appear straight). Try the 10.5mm Fisheye for that work.
Products from my answer
Nikon - AF DX Fisheye-Nikkor 10.5mm f/2.8G ED Wide-Angle Lens - Black
This is not a fisheye lens. Please click on the link below for the lens simulator; it will help you to make the decision on what lens you need. http://www.nikonusa.com/Nikon-Products/Camera-Lenses/index.page#c54-CID-1296509109099-tab-2
Yes. The Nikon AF-S DX Micro-NIKKOR 40mm f/2.8G Macro Lens is completely compatible with the Nikon D5000 DSLR camera. This macro lens allows you to get exquisitely detailed images at a 1:1 reproduction ratio. It's also ideal for creating breathtaking landscapes, flattering shots of people and stunning bokeh images, making it a great all-around lens for everyday photography.
Yes! The AF-S DX Micro NIKKOR 40mm f/2.8G Lens (Product 2200) is fully compatible with the D3200. This is a macro, or close-up, lens designed specifically for use on DX format DSLRs like the D3200.