       # RE: Drawing intrinsic coordina

```
----------
|Anyone know how (possibly with an add-in package?) to draw intrinsic
|coordinate graphs with Mathematica 3? Also, anyone know how to
|implement a RationalQ function that tells if the supplied parameter is
|rational or not, e.g.
|
|    RationalQ[Sqrt] = False
|    RationalQ[1/3] = True
|
Don't know what you mean about an intrinsic coordinate graph. But I can

There are several ways to do it.
It all depends what you want.

First approach:

In:=
RationalQ1[_Rational]:=True
RationalQ1[_]:=False

In:=
Clear[x];
{RationalQ1[Sqrt],
RationalQ1[1/3],
RationalQ1[Sqrt x+Sqrt(Sqrt/2-x)]}

Out=
{False,True,False}

Now is that right?
Sqrt x+Sqrt(Sqrt/2-x)  simplifies to  (3/2) but Out above
says it isn't rational.

To fix that you can use the next approach: If you really want to cover
your bases you can use FullSimplify instead of  Simplify, but it
sometimes takes a very long time.

In:=

In:=
{RationalQ2[Sqrt],
RationalQ2[1/3],
RationalQ2[Sqrt x+Sqrt(Sqrt/2-x)], RationalQ2[x]}

Out=
{False,True,True,False}

Now we see  (Sqrt x+Sqrt(Sqrt/2-x))   is considered rational.
Except I cleared (x) above, and Out above says (x) is not rational.
What  if you want to say
(x) may represent a number, and that number may be rational.  The next
approach fixes that.

In:=
RationalQ3[x_]:=With[{temp=Simplify[x]},

In:=
{RationalQ3[Sqrt],
RationalQ3[1/3],
RationalQ3[Sqrt x+Sqrt(Sqrt/2-x)], RationalQ3[x]}

Out=
{False,True,True,RationalQ3[x]}

Now  RationalQ3[x]   doesn't change during evaluation. We still find
that  (Sqrt x+Sqrt(Sqrt/2-x))   is considered  Rational.

Ted Ersek

```

• Prev by Date: VirusScan
• Next by Date: RE: Sorting of Data Lists
• Prev by thread: VirusScan
• Next by thread: Global Optimization - New product announcement