Using variables in packages
- To: mathgroup at smc.vnet.net
- Subject: [mg68059] Using variables in packages
- From: "akil" <akomur at wanadoo.nl>
- Date: Fri, 21 Jul 2006 17:35:56 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
I use the following two methods in teh same mathematica package:
lijnTussenVertices[punt1_, punt2_] :=
Module[{functie, richtingsVector, hoogte, p1x, p1y, p2x, p2y},
p1x = punt1[[1]]; p1y = punt1[[2]];
p2x = punt2[[1]]; p2y = punt2[[2]];
richtingsVector = (p2y - p1y)/(p2x - p1x);
hoogte = (p1x*richtingsVector) - p1y;
functie = richtingsVector*X - hoogte;
If[p1x == p2x, p1x, functie]
];
edgesPartFuncties[part_,aantalVertices_] := Module[{edgeFunctie,i},
edgeFunctie = {};
For[i = 1, i < aantalVertices,
i++,AppendTo[edgeFunctie,lijnTussenVertices[part[[i]], part[[i + 1]]]]];
AppendTo[edgeFunctie, lijnTussenVertices[part[[aantalVertices]],
part[[1]]]];
Return[edgeFunctie]
];
When I call edgesPartFuncties[part,aantalVertices] on a part with a certain
number of vertices I always get something like:
{\!\(\(-40\) + 2\ Global`Private`X, 200\/3 - \(2\ Global`Private`X\)\/3, \)}
How Can i fix this so I get X instead of Global`Private`X?
Akil