From 0d06e5a2c9f7d2bc24bda85b384915b35685ed36 Mon Sep 17 00:00:00 2001 From: David Gowers <00ai99@gmail.com> Date: Wed, 24 Dec 2008 14:35:33 +1030 Subject: [PATCH] * doc improvements for ion.n.coord.triangleWeighting (XXX convention!) --- ion/n/coord.py | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/ion/n/coord.py b/ion/n/coord.py index 4d4e4c5..f1b06d4 100644 --- a/ion/n/coord.py +++ b/ion/n/coord.py @@ -204,9 +204,29 @@ _twz = (1.0, 4.1887902047863905) _twordermap = {0:(1,2), 1:(0,2), 2:(0,1)} def triangleWeighting (radius, theta, *xyz): - """Convert a radius, angle pair to a set of three weights. + """Convert polar coords relative to the center of a triangle, to weights. - Radius should be on [0..1.0] + Parameters + ---------- + radius: float + in range [0.0..1.0] + theta: float + angle in radians + + Returns + ---------- + xweight: float + represents the weight of the topmost triangle vertex value + yweight: float + represents the weight of the leftmost triangle vertex value + zweight: float + represents the weight of the rightmost triangle vertex value + + Notes + ----- + Intended for equilateral triangles with line Y->Z along real x axis, and + X position being at 0 degrees to the triangle center (ie. directly up) + """ if radius == 0: return (1,1,1) -- 2.11.4.GIT