Re: [sage-support] How to calculate the affine coordinats of a point

2011-07-15 Thread Johannes
a very easy example would be this:

sage: p1 = vector([-3,1,1])
sage: p2 = vector([1,-3,1])
sage: p = vector([0,-2,1])

#now i'm looking for some x,y such that
#x * p1 + y * p1 == p

x,y = var('x,y')
sage: assume(x > 0)
sage: assume(y > 0)
sage: solve([x * p1 + y * p2 == p],x,y)
[]

#but: x = 1/4 and y = 3/4 is a solution of this equation.

in the end i need this kind of calculation for every latticepoint on the
border of a lattice-simplex. like the example above shows how it should
work for a line, it also should be extendable to n+1 points on each n
dimensional facet of the simplex, where the points p0,,pn are given
as the vertices of the facet.

greatz Johannes


Am 15.07.2011 03:27, schrieb William Stein:
> On Thu, Jul 14, 2011 at 7:39 PM, Johannes  wrote:
>> Hi list,
>> i have given a finite set of points (lets call it V \subset ZZ^n) and
>> have to express some other points p_0,\dots,p_k \in ZZ^n as affine (or
>> convex) combination of elements from V.
>> How can i do this?
>> I tried it with span(ZZ,V) but that leads to ZZ^n and the p_i are
>> written with respect to the default basis.
>> otherwise i tried it with the  sage.geometry.triangulation module, but
>> i'm not sure if i used it the right way.
> 
> Can you provide an explicit example, for example some Sage code one
> can paste in that defines your points in a simple situation?
> This always makes answering questions easier...
> 
>>
>> greatz Johannes
>>
>> --
>> To post to this group, send email to sage-support@googlegroups.com
>> To unsubscribe from this group, send email to 
>> sage-support+unsubscr...@googlegroups.com
>> For more options, visit this group at 
>> http://groups.google.com/group/sage-support
>> URL: http://www.sagemath.org
>>
> 
> 
> 

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] How to calculate the affine coordinats of a point

2011-07-14 Thread William Stein
On Thu, Jul 14, 2011 at 7:39 PM, Johannes  wrote:
> Hi list,
> i have given a finite set of points (lets call it V \subset ZZ^n) and
> have to express some other points p_0,\dots,p_k \in ZZ^n as affine (or
> convex) combination of elements from V.
> How can i do this?
> I tried it with span(ZZ,V) but that leads to ZZ^n and the p_i are
> written with respect to the default basis.
> otherwise i tried it with the  sage.geometry.triangulation module, but
> i'm not sure if i used it the right way.

Can you provide an explicit example, for example some Sage code one
can paste in that defines your points in a simple situation?
This always makes answering questions easier...

>
> greatz Johannes
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>



-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] How to calculate the affine coordinats of a point

2011-07-14 Thread Johannes
Hi list,
i have given a finite set of points (lets call it V \subset ZZ^n) and
have to express some other points p_0,\dots,p_k \in ZZ^n as affine (or
convex) combination of elements from V.
How can i do this?
I tried it with span(ZZ,V) but that leads to ZZ^n and the p_i are
written with respect to the default basis.
otherwise i tried it with the  sage.geometry.triangulation module, but
i'm not sure if i used it the right way.

greatz Johannes

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org