[Paraview] Slicing a sphere based on longitudes and latitudes

Moreland, Kenneth kmorel at sandia.gov
Fri Aug 5 10:26:41 EDT 2016


Lester,

This is pretty straightforward problem in geometry. As I give you the answer, I am assuming that your sphere is centered at the origin (as you said), the axis that runs through the north/south pole is along the Z axis, and the prime meridian (0 degrees longitude) is in the positive X direction.

Making a slice along latitude is simply a slice by a plane parallel to the x-y plane offset by the Cartesian location of the latitude coordinate. The parameters of the latitude slice plane are:

    Origin: [0, 0, sin lat]
    Normal: [0, 0, 1]

Note here that "lat" is the latitude measured in degrees with positive values for north and negative values for south.

A slice along longitude can be thought of as the X-Z plane rotated about the Z axis by longitude degrees. You can do that by setting the X and Y of the normal of this plane to the sin and cos, respectively, of the longitude angle.

    Origin: [0, 0, 0]
    Normal: [sin lon, cos lon, 0]

Here "lon" is the longitude measured in degrees with positive values for west and negative values for east.

You should note that this longitude slice plane will give you a full circle, which technically gives you both the longitude you asked for plus the longitude 180 degrees away. If you just want the semicircle for a single longitude line, you can clip away the half you do not want. You can do this with the clip filter (NOT the slice filter) with the plane set as:

    Origin: [0, 0, 0]
    Normal: [cos lon, -sin lon, 0]

As you do this calculations, be careful about degrees/radians conversions. Longitude/latitude is classically given in degrees and minutes whereas lots of computer trigonometry functions (including those in ParaView) perform sin and cos with radians. Also, if your sphere is oriented differently than I described, you will have to make corrections to these functions.

-Ken

-----Original Message-----
From: ParaView [mailto:paraview-bounces at paraview.org] On Behalf Of Lester Anderson
Sent: Friday, August 5, 2016 7:29 AM
To: paraview at paraview.org
Subject: [EXTERNAL] [Paraview] Slicing a sphere based on longitudes and latitudes

Hello,

Quick query, but is there an easy way to slice a spherical Earth model based on longitude and latitude while keeping the origin at the centre?

What I am looking to do is slice along a fixed longitude or latitude, e.g.

Longitude slice at 150 degrees; Latitude slice at -30 degrees.

Based on the use of a Great circle definition with the origin at 0,0,0. The data are stored based on the Earth radii. The reference frame (XYZ) orients with the axes  Z (+/- 90), X( 0,180) and Y(-90,90)
- overlaying a coastline vector goes in the right place.

I can see where the values have to be entered using the origin/normal but not entirely sure about the formula to use. Hopefully someone can give a quick pointer on this?

Thanks
Lester
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview


More information about the ParaView mailing list