math - how to transform a sphere to a hemisphere, smoothly -


i using 3rd-party "rotator" object, providing smooth, random rotation along surface of sphere. rotator used control camera (see rotator.h/c in source code xscreensaver).

the output of rotator latitude , longitude. want camera stay above "equator" - limited hemisphere.

i'd rather not modify rotator itself. take latitude output , use absolute value of it. however, smooth rotator movement across equator not produce smooth camera motion: bounce.

i suppose scale output latitude rotator current range target range: e.g. f(lat) = (lat+1)/2 map (0, 1) range (0.5, 1). i.e. map whole "globe" northern hemisphere. movement still smooth. intended "south pole" rotator become "equator" camera. wouldn't result in strange motion? maybe discontinuities? i'm not sure.

is there way map sphere (latitude , longitude) hemisphere, smoothly?

update:

thanks attention , responses. couple of people have asked clarification on "smooth". mean not jerky: small change in velocity of rotator should mapped small change in velocity of camera. if took absolute value of latitude, 0 change in velocity of rotator crossed equator translate abrupt sign-flip of velocity of camera (a.k.a. bounce).

iirc equivalent requiring first derivative of velocity continuous. continuous second derivative might nice don't think it's essential.

the velocity derivative of position. "mirroring" lat value, create "corner" in position function when hitting equator. so, in order smooth transition, need map linear position (i.e, latitude function of time) function changes near equator, , 1st derivative 0 @ equator.

tom10's suggestion mapping lat'(lat) = (lat)^2 example of such function. however, need normalize result lat'(90deg) = 90deg. so, correct mapping should be:

lat'(lat) = 90*(lat/90)^2

an alternative parabole sin() function, appropriate shifting , normalizing. depending on how want velocity close original velocity when "away" equator, can have higher or lower order exponent values, like:

lat'(lat) = 90*( |lat| / 90)^k


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -

PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -