Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2638 > unrolled thread

Re: get a, b from numbers in the form a+b Pi

Started byThemis Matsoukas <tmatsoukas@me.com>
First post2011-05-23 10:27 +0000
Last post2011-05-23 10:27 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: get a, b from numbers in the form a+b Pi Themis Matsoukas <tmatsoukas@me.com> - 2011-05-23 10:27 +0000

#2638 — Re: get a, b from numbers in the form a+b Pi

FromThemis Matsoukas <tmatsoukas@me.com>
Date2011-05-23 10:27 +0000
SubjectRe: get a, b from numbers in the form a+b Pi
Message-ID<irdcpl$3pu$1@smc.vnet.net>
The following is not elegant (quite brute force, really) but does what you want:

nums = {1/2 (-2 + \[Pi]), -2 + (3 \[Pi])/4, -(11/3) + (5 \[Pi])/4, 
   5/48 (-64 + 21 \[Pi]), -(61/5) + (63 \[Pi])/
     16, -(338/15) + (231 \[Pi])/32};
a = nums /. \[Pi] -> 0;
b = Expand[(nums - (nums /. \[Pi] -> 0))/\[Pi]];
ab = Transpose[{a, b}]

{{-1, 1/2}, {-2, 3/4}, {-(11/3), 5/4}, {-(20/3), 35/16}, {-(61/5), 63/
  16}, {-(338/15), 231/32}}

Themis

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web