Dynamic resp rotating Galaxies

For what's not in 'Top Priority Game Design'. Post your ideas, visions, suggestions for the game, rules, modifications, etc.

Moderators: Oberlus, Oberlus

Space Kraken
Posts: 124
Joined: Fri Nov 22, 2013 8:47 pm

Re: Dynamic resp rotating Galaxies

#16 Post by shawndream » Mon Jan 27, 2014 6:35 pm

I can't follow your math, but I am now sold on the concept of a slowly rotating galaxy being a definitely cool option to add strategic interest.

If the stars in the inner half of the galaxy rotate counter-clockwise, and those on the outer half rotate clockwise (with angular speed scaling linearly with distance from the midline) it is functionally the same as center spinning at twice the speed, while leaving the majority of the galaxy stable with respect to the user.

Two things are added to gameplay that are interesting:

1 - Individual starlanes come and go over time as the stars slowly change who their nearest neighbors are, a micro-strategic consideration as paths open and close.

2 - Groups of stars are smeared across the galaxy by the spin, producing macro-strategic considerations as static empires will find their borders shifting slowly over time. (Unless they own an entire ring around the galaxy).

I am shocked at how much Math I have forgotten since school, but I would suggest a simple mechanism for the "galaxy" (rather than using real elliptical orbital mechanisms).

Galaxy Major Radius = A
Galaxy Minor Radius = B

Galaxy Radius X% between A and B = X% of A plus 100-X% of B

Each turn:
1 - Move ships (to minimize orders wasted by galaxy changes)
2 - Move all stars by their normal current amounts based on their distance
3 - Find any stars too close to each other for easy selection and collide them
(drop lanes, possibly swap/destroy/combine planets and stars, move randomly, re-add lanes)
4 - Snap any starlane too long, or crossing a shorter one, or a planet (damage ships and move to destination)
5 - Find stars with fewer than normal connections and try to add starlanes to their nearest neighbors

If starlanes are always formed to their closest neighbors, and mostly last until they snap due to being pulled apart, they should spend most time in a condition of being stretched along with the rotation, giving the galaxy an overall slant along the spin.

Sadly, I must argue against the Z axis idea, I think the goal should be to make the universe behave as expected at first glance, unless there is even more fun the other way, and nothing about a hidden Z axis strikes me as fun.
Everything I post is self-created unless noted otherwise. It is simultaneously released under GPL 2.0 or later, CC Attribution-Share Alike 3.0, and GNU Free Documentation 1.2. Make something awesome with it please!

User avatar
Space Kraken
Posts: 101
Joined: Mon Jan 06, 2014 3:33 pm

Re: Dynamic resp rotating Galaxies

#17 Post by Adamant » Wed Jan 29, 2014 12:43 am

did edit reply about 12h today and lovely win vm destroyed todays whole work ... note i intends to reply ... anytime .. think now: what a peeetty. have anybody energetic meaning .. to add feedback?

shawn: did pro most but wonder about that two sections spinning counter-wise
later did not understand the min max meaning of two radii ... please review resp
tell what shall that effect or map?
Pure Cyan harms PhotoReceptors doubtless - even half Portion appears mysterious.

Space Kraken
Posts: 124
Joined: Fri Nov 22, 2013 8:47 pm

Re: Dynamic resp rotating Galaxies

#18 Post by shawndream » Wed Jan 29, 2014 8:38 pm

Adamant wrote:did edit reply about 12h today
Please remember, fewer words translate easier.
Adamant wrote:wonder about that two sections spinning counter-wise
As Adrian said, only RELATIVE motion can add real gameplay value, otherwise could play the same by turning your monitor a bit more each turn.

I think most expected motion for a swirling galaxy is for center to swirl faster than outside:

http://www3.amherst.edu/~gsgreenstein/p ... al_galaxy/

Notice the whole galaxy rotates the same way, but the center spins very fast... perhaps too fast.

Let us say the outside rotates barely at all, the middle 2x per minute, and the center 4x per minute.

If you were to rotate your head or the window 2x per minute while playing the above animation it would look different (even though it was really the same)

The outside would appear to rotate the other way 2x per minute (it stood still while you moved ahead, seeming to fall behind)

The middle would mostly move with you, but the parts towards hub and rim would slowly spin apart.

The center would seem to rotate slower, only 2x per minute compared to you.

This gives most stable view for a given speed of churn.
Adamant wrote:later did not understand the min max meaning of two radii ... please review resp
tell what shall that effect or map?
Most people's idea of galaxy is elliptical, not circular.

I think because galaxies are like coins floating around us in space randomly, few are facing us directly to look circular, instead, we see them elliptical at an angle.

Ellipses have a long radius and short radius: http://tic.wpengine.netdna-cdn.com/wp-c ... gram_2.jpg

Doing elliptical galaxy is more interesting than doing a circular one because the systems (even in a simplified fake elliptical where they just rotate at constant angular velocity dependant upon their fixed relative location between hub and rim) are closer together near the minor axis and farther apart near the major axis.

Closer together they are more likely to collide and break lanes through coming too close to stars.

Farther apart they are more likely to break lanes through exceeding max distance.
Everything I post is self-created unless noted otherwise. It is simultaneously released under GPL 2.0 or later, CC Attribution-Share Alike 3.0, and GNU Free Documentation 1.2. Make something awesome with it please!

User avatar
Space Kraken
Posts: 101
Joined: Mon Jan 06, 2014 3:33 pm

Re: Dynamic resp rotating Galaxies

#19 Post by Adamant » Thu Jan 30, 2014 1:47 am

Code: Select all

I read first Line for Moment and continue pasting my edited Post and then go to bed.

POST:  some Lines - as usual  ;)

Brief Introduction into Complex Numbers

We know different Kinds of Numbers:  Natural Numbers N, Rational Numbers Q, Integer Numbers Z and Irrational Numbers and RealNumbers R.

Natural Numbers are those we use to count Things in Nature, eg 3 Birds, why that got named that Way: findable in Nature.

We can calc arbitrary Sums sum=a+b.

REF Peano-Axioms  PA -- Construction of Natural Numbers # Second Construction exist using Set Theory 
REF Group Theory   GT

PA:  We may wonder if we start naturally with One for Counting or use Null to init that Matter.
Lets count green Elephants. Init-> cnt=0... um .. completed.
There exist different Ideas but for math there exist different Kind of Sets named Natural Numbers,
while Difference is if Number Null is natural Member or is not.  N^>0 and N^>=0 exist.
Symbol ^ as liteal Meaning to express SuperScript liked used for Exponents and _ for SubScript
like used for Indices. -- LaTeX-Notation resp Codition.

GT is Theory which offer the Meanings  to proof if something behaves like a Group.

Due to N builds Group for Addition we know resp can calc arbitrary Sums:

OP:  Class/Type Operation resp Combination:   This op is Member of OPs 
o: generic OP  -- ANY OP 
B: BaseSet     -- Input
V: ValueSet    -- Output

GT: §E: Enclosement:    ALL  a,b€B a o b = EXIST c € N           Apple plus Apple not get Pirs  -- no other
                                  ALL  a,b €B a o b -> V SubSet B          ALL Set M are (untrue) SubSet of Set M  -  SetTheory ST
GT: §U: Unique:            ALL  a,b€B a o b = a o b                     Apple plus Apple equals always two Apples --  same 
GT  §C: Completeness:  ALL  a,b€B a o b EXIST  c!€{}             a div b not defined for  b=zero  -- not none
GT: §A: Associativity:    ALL  a,b€B a o (b o c) = (a o b) o c      Apple and (Pir and Citrone) equals  (Apple and Pir) and Ploom
GT: §N: Neutral Element  EXIST ONE n€B that a,n€B a o n = n o a = a        2+0=2   
GT: §I:  Inverse Element  EXIST ONE and ONLY ONE a'€B that  a o a' = n     5 + -5 = 0
Cummulative Group 
GT: §K:  Cummulativity:  ALL a,b€B a o b = b o a                    Apple and Pir are Pir and Apple

FYI: ST: EmptySet {} is always Member of all Sets  >> §C:  c have to be not Member of EmptySet --  c !€ {}

IF we add a Natural Num a with another Natural Num b we get Result c which is also a Natural Num. 

We know similar OP SUB  Subtraction:   a-b = c €N^>  0  IF and only IF a> b  
resp for                                                        c€N^>=0  IF and only IF a>=b

As we can take for most a any b that is greater than a we find than not each Pair a,b is enclosed in that Set

Exist a,b € N a-b -> c !€ N   -- Subtraction for NaturalNums build NOT a Group! (§E not fullfilled)  

When take Z -- Integers -- we can find that Z build for both Addition and Subtraction a Group.

Big Point here: extending BaseSet N to Z changed BaseSet to fullfill §C .. but Z,- is not Group:

a,b,c €Z   ALL  (a o b) o b = a o (b o c)  

(3 -  4) - 5  = -1 -5  = -6
 3 - (4  - 5) = 3 - -1 = 4
4 != -6 
=> !ALL a,b,c € Z fullfill §A => build not a Group!

(3 + 4) + 5 = 7+5 = 12
3 + (4 + 5) = 3 + 9 = 12
§A true for Z,+


§A true for at least one Combination of Members of Z 
but that does not make whole Set Z to be associative
which is necessary for Set to build a Group. 

We have to test for ALL Combinations! 
Consider here Peano-Axioms and its Construction Rules:
n=1  -- Induction Init
n++ --  Induction Step

FYI -- rational Work would be to pick a Set, take DFIN of OP
and DFIN of Set and combine their Meanings with GT to proof
for whole Set and OP if is GT Group but a single Combination 
proof the Opposite.  It have to work for ALL Combinations
means No Combination is allowed to work not.
Disproof of ANY of ALL easier than Proof for ALL.
Proof for NONE of ALL easier than Proof for ALL. 

Neutral Member

Examplary ..
3 + 0 = a
0 + 3 = a 

4 * 1 = 4
1 * 4 = 4
1 * 5 = 5

0 is Neutral Element of Addition of Natural Numbers
1 is Neutral Element of Multiplication of Set of Natural Numbers (for Integer and Rational and Real as well)

Inverse Element
4 + 0 = 4
0 + 4 = 4 


3 * 1/3 = 1
1/3 * 3 = 1  

0 * ...  = 0   -- Null, Neutral Element of Addition of Rational Numbers, does NOT have Inverse Element!

...  build a Group!   (Not shown here)

Cummulative Member

3+4 = 4 + 3  
    7 = 7

Set of Natural Numbers build for Addition a Cummulative Group.
A Group is a Cummulative Group if it fullfill §C!

Mod_m = {n| n € N>=0 and n<m}

EG   Mod3 = {0,1,2}

Check for Group-Properties:  B=Mod3  for OPs +,*

Example  a+b=  2+2 =  4 -> 1   2+2=1 , ya know?
Meaning  CombinationTable

0 | 0    1   2
1 | 1    2   0
2 | 2    0   1

In the Table...
§E:  EACH Entry is Member of BaseSet  ENCAPSULED!
EACH Field has ONE Entry=>
§U:  NO Field     has multiple Members   UNIQUE!
§C:  NO Field     is empty
There is in each but first ROW/COL for Operands has exactly one Element =>
§N:  EACH has exactly one Neutral Element  NEUTRUM!  Neutrum+ = 0
§I :  EACH Member has exact one Inverse Member          Inverse+  a,-a
Module3 builds a Group for Addition!!!  => GROUP!

§K:  Table Entries are symmetric to Diagonal (n,m=n)      a+b = b+a

Modulo3 builds a Cummulative Group for Addition!


* |_0_1_2
0 | 0  0  0 ** Neutrom of Addition!
1 | 0  1  2
2 | 0  2  1
     Neutrum Of Addition    DROP THAT Neutrum-Combinations-Lines ! (not Member of B here!!!)

* |_1_2
1 |  1  2
2 |  2  1

One Entry per Field, Neutrum is 1, cummuative! =>  Mod3>0,* is Group!

NOW:  (Terms,Detais..HalBody and Body. Ring?)
Mod3,+,* builds a Ring (or Body? or HalfBody?1?.. that is important!! :)) 

If you like HomeWork: Check for Group-Properties for additinal BaseSets:
Modulo_n with n€{9,8,7,6,5,4,3,2,1,0}  // wooow - sooo much!!! :/ yoyo!
Please do check first for each § of §EUCNIAK one-by-one! Try other
Order! What Depencies exist?

Use other Sets or OPs than from Aritmethic:

Sign = {+,-}
MOD2: ODD or EVEN -- aready covered?

Bits = {0,1}   OPs AND ... huh?!? OR, NAND, NOR, XOR, XNOR, IMPL, NIMPL  

& 0 1   
0 0 0  
1 0 1

| 0 1
0 0 1
1 1 1

Compare the Table as Profiles Entries abstracted to symbols:

o a b
a w x
b y z     y=b, x=b, z=a, w=a  where saw that perhaps before?

Analyze GT Scope of Mod_pwr  for  power of 2: 2,4,8 and compare Profiles
Same Power of 3:  3,9, ....81 gets challenging :) or may be not?  
GT for Mod6 and compare with Mod3 and Mod2.
Consider Meaning of Primes in that Matter (fishing in the fog) 

Funky: Colors!

RGB, +,-



Special Mod:  B-R = GB = C

Respect Scientist Goethe here  -- wiki for Color-Addition and Subtraction   :) 

You know Set? You know Arithmetic?  You know Groups?  You dont know Groups? 
Dont tell me you know Arithmetic if you dont know Groups!!  :)

I assume you read above and interupted Lecture for some Weeks  and now 
continue here with good Idea what Group Theory means for Arithmetic and
other. Rubrick Cube or Knots and other Things exist which build Groups.
For that Cube it simple to proof Enclosement: you may turn it arbitrary
but you are not allowed to byte into that Cube - not supported Operation!
Without Bitting Result should be Member of Set RubrickCubeStates. OPs
have to define resp suited Notation for OPs Axis x,y,z X L,R X 1,2,3 Layer.
Before States GT do OP-GT

(Consider that many OPs are quasi obsolete due to they are useless like
Addition with Zero ...  This Exercise is Kind of Advanced Group Train with
exotic/foreign/abstract Elements other than Colors or Numbers we know
well and thus forget that these Numbers are pure Abstraction due to got
usual .. you may consider self to yet another Execise or study Math for
Years... sure GT is powerful as you use its Numbers)

434324334+2334533453 =   solvable surely!

B = {x,y,z}X{1,2,3}X{L,R}X{0,1,2,3} + NOOP  ## 4x18+1 OPs

Here init GT CHK how Combinations of OP behave:

_O_ NOP X1L X1R 

EG Functions as Set:  f(x)+g(x)  resp Addition and PolynominalFunctions

f(x) = a0+a1*x^1+a2*x^2*..

You used GT even you may not know about.

sqrt (4) = 2  ... ONLY 2!   DFIN  SQRT of Positive Real is always positive!

Absolute Value Function:

|x| :=  +x for x>0 , -x for x<0


|x| = 3  => Lx={-3,+3}  # x is not both, right?
|x-4| > 7  => :)

Case1: (x-4) >=0
+ (x-4) > 7
x-4 > 7  |+4

Case2:  (x-4)<0
-(x-4) > 7  |*1   NOTE RELATION!
+(x-4) < -7 | +4
x < -3

Lx={x€R| x>11 OR x<-3} = R \ [-3..11]

Execise more
|x| = -3    --- oh that is sooo simple  .. do it formal correctly!!

Now you learn perhaps first Time to calculate corectly SquareRoot from Variable! 
(may be you already to get moderate likely correct Value )

       x²  =        4     | sqrt 
sqrt(x²) = sqrt (4)    | solve
      |x|  =        2      | Absolute Value

Is x positive or negative?  Case Differentiation!

Case A: x>=0  =>  +x =  2
Case B: x<0    =>   -x = 2 =>  x = -2

SQRT with negative Value?!?  RIGHT!   
SEE DFIN: SQRT of Positive Real is always positive!  (true)
x is a Variable which EITHER is positive OR negative -- and we checked for both Cases!
We may assume that X is not both positive and negative same Time!

sqrt(-4) = ...   what ever it is -- no Square of any Real Number results in negative  Real Number!
DFIN SQRT(x)    sqrt_x is Num that match sqrt_x * sqrt_x = x

FYI:  Greeks noted that Diagonals for Squares exist and sqrt 2 is not a Rational Number!

Irregular Falsi:  Assumption sqrt2 IS a Rational Number! => EXIST a,b€N that a/b=sqrt2  

Now Kind of Magic!  Fraction a/b is reduced Fraction!  What? They do exist, do they? We  say that one is reduced - o'la!

a/b = sqrt2   | Square!
a²/b² = 2     | *b² 
a² = 2 b²      => a² is EVEN! => a is EVEN!  would a be odd a*a would be odd 
                     -- substute a with a' while 2*a' = a  
(2a')² = 2 b²  
4 a'² =  2 b²   | :2
2 a'² =     b²   | when we iterate last Steps we would do effectively reduce that Fraction by 2! 

Resultat:  Fraction a:b is rather odd as it can not be/get reduced Fraction. That does not match to Fractions we know!
We defined it is reduced already (we are allowed to, are we? what means answer no?) 
Ergo sqrt2 is NOT a RationalNum!   That was to proof!

Proof used Irregular False and falsificated the Opposite of that what was to proof:
We said: we proof sqrt2 is NOT a Rational and started with assuming the Opposite
and failed due to wrong Assumption.  We did right in Proof but Error was Assumption. 

When you are a Photon you can move through Glass! Assume you are and try and tell me what happened.

That Way like Greeks find that Square 2 is not a Rational and found other Nums like that and
put that into Set named Irrational Numbers.  Negative Numbers discovered in Century ... IIRC
16,17 or was it 18?  Rather late and not ancient Greeks!  Greeks knowed about R>0 resp even
that Zero was great Dicovery!  New Number! Num=0! What can it? Add and Mul!  Results?
ADD a+0=a and MUL a*0=0 -- DIV by Null fails!  Great!  (seems like Profile for  important
Sqrt(-4)  !€ R 
Sqrt(x) = -4   x !€ R

N extended by nagative Numbers means N gets enclosed for Subtraction resp Z,+ gets Group
Z extended by Fractions to RationalNums Q: q = a:b with a,b€Z encloses Set for DIV resp Q!=0,* get Group 
Q extended by Irrationals to RealNums R:  sqrt x = y with  y*y=x   y,x€R

NOTE   OP Power has two inverse OPs:  

Power: a^b = c

Power  b'th Power  of a = c                with  c = a1*a2*..*a_b   and a_i=a   
ROOT  b'th Root    of c = a                with  c = a1*a2*..*a_b   and a_i=a
LOG    Logarithm  of c to Base a = b   with  c = a1*a2*..*a_b  and a_i=a 

Example:  3^4 = 3*3*3*3 = 81

4th Power of   3 = 81   
4th Root   of 81 = 3
3th Log    of 81 = 4   ## generalized Verbal Syntax 

You are welcome to say that's all the same instead you may say: Oh that scarry Logarithm! :)

sqrt(2) * sqrt(2) = 2  per Definition! (also numerical for correct sqrt2 as defined as its Square equals that)
2^(1/2) * 2^(1/2)  = 2^(1/2+1/2) = 2^1 = 2   ... hu?   So is Root for real a Power by Fraction?
Log2 sqrt2 * log2 sqrt2 = 1/2 + 1/2 = 1   => 2^1 = 2

What is that?  Log concerns to that Tripple but is anyway different. Let see:

I assert you know well the Powers of 2 resp can easily accept binary Units K=1024 = 2^10   M=K*K = 2^20

2^15  * 2^23  =  32K*8M = 256G = 2^38

2^15 * 2^23 = x     | Log2!   #### COMPARE THIS LINE WITH ...

15 + 23 = Log2 x                 ####  ... THIS LINE !!!  

38 = Log2 x   | Power Base 2  Pow2

2^38 =   2^Log2 x = x  


To describe Effect of LOG briefly:  It breaks down OPs in Equation for one Order  -- here get MUL to ADD!
That was the special Sauce for CalculationRuler which was common before electronic Gear made all better.

NOW really treat ComplexNumbers... 

Most difficult Matter to solve is perhaps Constructive  Origin of 
Complex Numbers  Essential:   Imaginary Unit i

   You may wonder where to find i in Nature but easier is to invent it!

   Imaginary Unit is that Num that accords to  i*i = -1    .. tada  (I tried to suppres that, really)

   When you ask why that works - do it via Invention - the plain Anwer is due to it behave logical flawless. 
   You could construct or define other Things like plain oo (laying 8) means INFinity via  1:0=oo
   oo+oo = oo  | :oo
   1 + 1  = 1  FALSE  - that Construction does not work!

   1/n Limes n->oo  = 0 (n versus does not exist?)
   When you learned Infenitesimal-Calculus then you learn this h=1/n n->oo are  better suited Kind of Zeros there   

   BTT  Imaginary Unit
   What is that Num?  When you are used to map Numbers to NumberLines and put perhaps we have large Model
   painted on Ground and you stand at the 1 and me stand still at the Zero and ask me where is that other Unit
   I would take take the Brush and make a crossing NumberLine through same Origin at NULL and call that other
   the Line of Imaginary Numbers.

Greek took the Frationals as rational while the later Roots revealed Existence of strange behaving Irrational Numbers.
Now imagine the Imaginary Numbers and add them crossing with the Natural at Origin Null and expand Lines to
a Plane.

Apples plus Pirs are  Pirs and Apples!  That Lession for a+b anytime made in School. Use that now and second
Unit rather analog to 1 now is i
a,b € R
1:  3 = 3*1 = 1*3 -- we write briefer 3 in most Cases  -- right now somewhat lesser often  
1:  a = a*1 = 1*a 

Analog i:

i:  3*i = i*3 = 3i = i3 
i:  b*i = i*3 = bi = ib   
When sum up natual Apples and imaginary Pirs  we have just to accept  that  3a+4b != 7a resp 7b resp 7ab is
and  3+4i = 4i+3  while it is Kind of Convention or Style to order the imaginary Part second - we may resign for.
Without really effecting special Meaning we can group that Sum by Parenthesis:  (a+bi) to handle it as whole
... as usual for Parenthesis!   As that Group represents a Complex of different  NumberTypes that complexed
Numbers are called ComplexNumbers.  I am not sure how much Attention concerns to Set of Imaginary Nums
but more Features offer the ComplexNumbers C.   

Now we can do that:     sqrt (-4) = sqrt(-1) * sqrt 4 = i*2 = 2i = i2   -- better prefix Axis

You did surely experienced how to draw Value-Pairs from x and f(x) into Graph - a Function Graph.
For C resp c€C similar Graphes are meaningful but respect that a Point in that Graph does not
represent a Pair of Real VAL x€R and RealFunctionValue f(x)€R but a c€C.
Usual for Complex Functions is same Symbol for Function:   f() while VarType indicated with c:  f(c).
f(x)  Real Function
f(c)  Complex Function

For Addition  a + bi =  (a+bi)  = (1a + ib)  = (+1a +ib) =  (0 +1a +ib)

c  + c = 2c

c1 + c1 =  2*c1 = 2c1 = 2 (a+ib) = 1*2a+ i*2b =  2a+i2b

c1 + c2 =  (a+bi) + (d+ei) = a + bi + d + ei = 1*(a+d) +i(b+e)   = a+d+ib+ie  

Multiplication is easy like easy it is using plain extended Lemmar Distribution for C:

(1a+1b) * (1c+1d) = a * (c+d) + b * (c+d) =  +ac +ad +bc +bd
(1a+ ib) * (1c+ id) = a * (c+di) + ib * (c+di) =  +ac +adi +ibc +bdii  
= +ac +adi +ibc +bdii   | substitute i*i = -1
= +ac +adi +ibc -bd
= +ac-bd  +  iad+ibc    # easier to pick i as prefix
=   ac-ad  +i (ad+bc)    #  So, that's it -- without concrete Values we can not do more here.

To do rational Work with ComplexNumbers you need still some Gear:

Two special Function - I could say Getter for C++  ;)

IM(c) = IM(a+bi) = b
RL(c) = RL(a+bi) = a

And Notation is somewhat odd ... Kind of Asymmetric Negation:

+c = +a+bi
-c =  -a-bi
c^ = a-bi      # One gets called conjuncted but I have two Flavors of # Matter of Tool Gear!  Drop Roots for Power!
c_ = -a+bi    # I try to handle 1maginal and imaginal same -- complexer unlisted Reasons exist 
c^+c = +a -bi +a +bi = 2a

1/2 * (c^+c) = (a-bi+a+bi)/2 = a = RL(c)   # who want to write that whole Time?

c_+c = -a+bi +a +bi = 2bi   analog  IM(c) =  (c_+c)/2

c_-c  = -a+bi -a -bi = -2a    -- can via Div by -2 use it for RL(c)
c^-c  =  a-bi -a -bi  = -ba    -- can via Div by -2 use it for IM(c) -- but is not rational

First Application is Complex Pythagoras:   a²+b² = c²

We can map a,b into single Number c = a+bi
First Shot with plain complex Square:

EG a=3 , b=4

(3+4i) * (3+4i) = 9-16+24i = -5+24i ... disappointing for first Time - Geometric Meaning of plain Square resp Mul treated later.

c*c^ + c*c_                               
= (a+bi)*(a-bi)+(a+bi)*(-a+bi) 
= aa -abi +abi +bb = a²+b² 

# RL(c)*RL(c)+IM(c)*IM(c)  effects same 

We see here no clear Advantage from new Gear - we see just we can map it to Pythagoras

R RE2(c) {return c*c^;}
R IM2(c) {return c*c_;}

Now want to translate that for Imaginary Watchers in Imaginary Units..  can we avoid plain MUL with i to archive it?
C RE2(c) {return ??}
C IM2(c) {return  ??}

All Squares of Imaginary Numbers fall out of Imaginary Line to negative Real Line.
Preliminary Result is not that easy but direct via MUL with i of Results - we may
wonder what that could return ROI?

Try to fix imaginary MUL resp add special MUL  that  i X i = i

I imul (I1,I2) { return -i * I1*I2;}   ## imaginary it seems that Product needs Fix for proper Dim   

Analog  real MUL   ReUnFixed:

U umul (r1,r2) {return u*r1*r2;}  ## we say it is not anymore Real but Unreal

R rmul (u1,u1)  {return 1* u1 *u2;}

Perhaps Remind:   Line Number and Area Number -- Line a x Line b = Area a*b

So may this U be Kind of A for Area here?  And U for still undiscovered Type?
Here skip that Direction and aim for Geometic Interpretation of C-MUL.

CHK  SEQ of Complex Func  f(n) = i^n

SEQ is:  i,-1,-i,1,i,...  -- short Cyclus

When draw that SEQ on Graph we see that the according Vector rotate counterclockwise
around Origin with constant  Lenth.

To calculate its Absolute Value correctly we need that Pythagoras Matter to describe Function:

R |x| {return sqrt (c*c^+c*c_);} 

Note that there exist no equivalent Order-Scheme for c€C like for scalar resp simple Numbers.

You may invent different Kinds of um call them Gradient-Functions which map the Complex to
Scalar Numbers - some tried to use the AbsoluteValueFunc to cover with something special but
afaik (and I still did not try better) were no stunning Results extracted from Approaches to map
analog Gauss Function (Absolute Value) C->R for which a natural Order Scheme exist, which
allow Application like Meaning for Transitivity:

a>b and b>c  => a>c  
a>b              => a+c > b+c    

If we draw for each c that accord to |c| = const Radius r a Point on Complex Graph than these
Numbers get reverse mapped by Gauss-Function as Order-Criterium mapped to their Radius.
Similar we could also use linear instead radial Mapping and use eg RL-Axis or IM-Axis as 
determinating Criterium which means eg for RL-Axis that the Complexes get projected at
that Axis reducing Order to the Real Part of Complex resp analog IM-Axis to the Imaginary
Part of Complex Number.  When we think that Axis to be Kind of arbitrary Lines we use to
map than this Approach appears for first same rational like a Spleen to see all scaler like.

I can resp did sadly still not resemble that Work and dont know who figured out .. no who
published first that Discovery (you may know enough about Math to guess who was doubtless
first - he did not publish all due to .. well, we know thus about many other great Mathmaticals)
though Discovery was that ...

Have to do some Basics before concerning Logarithms:

You may find any Gear, Graphical Calculator or better Paper and Pencil and Ruler,  and draw
into same Graph Functions of Form f(x) = log_b (x) while HERE b means Base and for b take
eg  b=2 , b=e, b=10 - most common Log Bases - some Pocket Calculator have Keys reps
ccording Functions for all these three.

Log_b(x)  for b=1 is ... I am not sure if anyone defined, but when I remind correctly
we could take Graph from  b->1 and then Line should be (quasi) const 1.

IF you want to get better Idea about Behavior of Graphes of Log_b depending from b,
you can easily calculate Values for other Bases when you have at least one Log in your

b = Log_a(c) 
Log_a(c) = Log_B (c) / Log_B (a)     while B is arbitray Base, eg a=e  Euler

So need 2x use Log and 1xDIV to get LOG for arbitrary Base solved - you may perhaps
still not know what to do with Log and prefer to ignore it - but when you have to deal
with you can encounter to need LOG with special  Base and then would have Trouble
to find out how to solve that Problem due to you are likely to search for special
Solution like  Log_pi and can find with a Lot of Fortune. Hint: keep that Matter in

  Log_a(b) = log_x(b) / log_x(a)    for any x €R!=0>1  as Base

NOTE that there is limiting important Number noted in that Spec: aside of Neutrum for MUL
adjecting is Neutrum for ADD.    For negative Numbers their Power altenate due to alternating
Sign,  see   f(n) = -1^n 
Would I know how to calculate  f(x) = -1^x  x€R than I would like to try what Graph that 
Func return and when Result alternate over x-Axis, where the Null-Places are and how these
depend from Base resp neigboured Integers.  eg  Null-Place at x04=3.456...  how relate
x04 to x=3 and x=4 ...  resp when alternate really continously  and when eg x=3 Supremum
then x=4 Infinum (Term? Supremum moderate  sure but Infinum appears me wrongly correct
resp cant deal that Meaning to me with Meaning for local Minimum)
But Matter is start stunning still now how to calculate that for ... perhaps did not try again?

Can hardly that at Moment Irreal Nums but instead focus on Fractions

a^(b/c) = a^b * root_b (a) -- the Power appears simple, the Root tricky for precise Approximation
of x via a/b and Root is rather expensive to calculate due to it does need many Powers from
tested Values to approximate.  Think Way of  Implementation of DIV via  guessing Quotient
and MUL guessed Quotient with Divisor and use it to find a better approximating Quotient.
That Way does 2nd Root MUL two Factors per each Test. For 3rd Root had to MUL 3 Factors
but that means  for Func above that Divisor of Quotient which is Exponent  for a is rough 3.

NOTE to simplify Work you could do this:
Load first Entry of an Array with SQRT(a) and next Enty with SQRT from previous Entry.
For 10 Entries you Calculated the divisorbase d = 2^10  1024th Root of a.

When you iteratively calculate c*=d 1024 Times c should get a.
You may compare that Value with previous a to get Idea about Error from Rounding.

To give a Hint:  when a is close 1 then the Graph is really close to const 1 Line.
Trying even closer 1 a means that it gets somewhat more closer to that Line.
Same reasonable is to see how a Overrunning Counter get large.

EG:   DivZero the HardWay

div0 (int x) {int cnt=0; while (x)  cnt++;}  // no - complete in Sense of Operation

Would that CNT not overrun we may assume Result would get really large while
Time but I can not extract any useful Information from. First use Head before
throw Code on Problem eg wait for div0 for Hours due to expect precise

WHEN use just 10 Entries you can reduce RoundingErrors when assembling
Fractional Root  resp  Fractional Power with  Exponent = n:1024 n€0..1023

BRIEF NOTE_ We are here already about  MAtters which relates directly
with Implementation of Rotation-Issue! Note the following Algorithm!


int frac [3]   // we can drop float here and use static Fraction  eg  short Integer and short Fractional Part  n/64K

Binar Float:  Int32s   Note POINT for Float in Representation:
0000:0100.0000:0000  => INT = 0b100 = 4   //  div by  64 -> shift 64=2^6 => SHR 6 -- >>6
0000:0000.0010:0000  => 4/64 = 1/16  --- is anything in Dezimal .

We can via Modulo 10 convert OutPut-Data  Binary Fraction into Decimal Fraction
BUT we do NOT need to use Decimal Fractions like Float with Mantisse which tries 
to let CPU calculate with our 10-Finger-Numbers as it has just 2 Digits=Finger per

WHEN stars with Base=2 we can easily determine Loss from Rooting when eg 1024th Power of 1024 Root
iterated calculated via MUL then we can easy sub calculated Base with given Base 2:   b_def-b_calc
RESP  Quotient b_calc : b_def as 100%   RESP  1.0 + b_calc-b_def Respecting used Point get Num<1.0
eg 99.998% or something like.

Then compare with:

I32s* frac1 = new I32s [32];   // wiil we have at frac[63] have a bit set remaining?
I32s* fracN = frac;
*fracI = 2; fracIN++;  
*fracI = sqrt(   *(fractI-1)   ); fracI++ 
*fracI = sqrt(   *(fractI-1)   ); fracI++ 
*fracI = sqrt(   *(fractI-1)   ); fracI++ 
*fracI = sqrt(   *(fractI-1)   ); fracI++ 
*fracI = sqrt(   *(fractI-1)   ); fracI++ 
....  copy&paste easy like while (fracI^frac0)

NOW the Trick:
If we Ignore concrete Values from Root this behave like Bits for a Number resp Fraction:

2/1024 = 1/512 
3/1024 = 1/1024+1/512
4/1024 = 1/256

We have Fractional Roots for Power 2^(n/1024) 

and if we put n as Fraction:

0000:0000:0000:0001   0/512 + 1/1024
0000:0000:0000:0010   1/512 + 1/1024
0000:0000:0000:0011   1/512 + 1/1024
Can we assemble the Exponent via Product of Bit-pointed Factors from Array.
This is of Course NOT faster than Iterated exponent*=smallest_root_fraction
BUT more precise - if Precission matters.

NOTE: that eg for n=1024 the Approach above is even absolute precisse due
to the first only set Bit of n points to first Entry of Array and that  contains
precissely 2!   Each Entry may have specific Unpression and thus accumulate
Errors per each Multiplication when the Fractional Exponent gets calculated
via a* frac_product(long n)

For the upper I32s which represent the Integer Part of Exponent we can simply 
do similar while (interger_part) {power*=base} (but we can do better, ya know?) 
while for the Precission-sensitive Fraction Part we sample it from precalculated
more precise Fraction-Roots.  Of Course that Binary FloatingPoint exist just as
our IDea - we can same Way deal with all 64 Bits from Argument n BUT due to
there are no Losses inside the integer PArt from Root we can do the integer Part
faster and same Precise - we had just to store the integer Product from previous
iterations and shift it here for a Bit left and mul it with FracRoot.  

HERE in Context of Thread Matter that Algo above can help us same Way with
Fractional Turns as if we spin Galaxy via complex Spin-Factor which Absolute
Value is Length=1   

Know the Geometric Interpretation of Complex Multiplication:

When we construct Values for a 8-Step-per-Turn-DataSet, we have
to deal with 8 different Values.  But 4 are already complex Integer:

f(n) = i^n    

Sequence is  i,-1,-i,+1,i,....   Periode resp Cyclus is 4 Resp Modulo 4 

 Now construct first Refinement:  via Pythagoras we take  c²=1

a²=b²  a²+b² = 1  b²= 1-a²

a² = 1 - a² 
2 a²  = 1
a² = 1/2  | sqrt
a = sqrt (1/2)  
a = 0.707...  = b
We can store also Values for Seq 1..-i their Values inside Array 
with the complex fractional Values and Algo does not have to care
about integer or Fraction - that Idea of Point exist for the Programmer

As decimalic  Binary Nums:

10 *10  =  0100.
1.0*1.0 =  01.00
.10*.10 = .0100

We crunch Integer and it is up to use to use them according to Idea of
Position of the Point and can easily fix the Point-Issue via quick Shift 

Float is much slower than Int while Shift is really fast - even faster than
INC but both need normal 1 CLK - Shift does not take half CLK but
minimal OP Time.  May be PipeLines in CPU can utilize half CLK anyway
but we may assume it eats 1 CLK and we should not omit to use it when
ever apropriate.

Scientists us Numberss like   1.324235 E11  while E11 means 10^11.
Analog for Binar-Fractions we could introduce Binary Exponent

1.0101111001  B7  and B7 means   num* 2^7  and we MUL to numbers
by ordianry MUL but Exponents gets sumed.

2.346 * 2^5 *  4.332 * 2^-6  = 2.346*4.332 * 2^(5 + -6  = -1)
For Addition we have to get both Exponents same:

_3.444     Point defined by Exponent -- think here Decimals are Binaries
+34.44    We just have to deal with the Point representing Exponent MEANING

We may assume the Number starts with first Bit for Number and Exponent shift
resp set resp define the Point properly.  We can not shift the Number to left and
drop that Way most significant Bits but drop the Bits to right of the smaller Num
we can easily determine by Exponent Comparisions - if both Exponents are equal
we dont have to shift Bits to match their Points. 

Kind of Prototype - did not add Balancer to adjust Mantisse and Exponent for better Point 

Frac  add_work (Frac& frac1, Frac& frac2)  {
 register I08s  shift          = frac1.exponent-frac2.exponent; // float-diff  
 register I08S  fix             = shift        >    0               ;  // SLCT/INIT IDX OK?  
 register I08S  sign           = fix                                  ;  //
                     sign           = sign       <<< 7               ;  //Sign now its 0 or -1           1 CLK!
                     shift         *= sign                               ;  //shiftdir now positive!!  Char-MUL takes about... 5 Clks?!?  
 register Frac   frac [     2]                                          ;  //
                     frac [fix^0] = register   new Frac(frac1)   ;  // Copy Arg for Init Reply and fix Reply left ARG untouched
                     frac [fix^1] = register   new Frac(frac2)   ;  // Copy Arg for Init Reply and fix Reply left ARG untouched
                     frac [fix    ]  . exponent -     shiftdir         ;  // fix right direction? 
                     frax [fix    ]  . mantisse >>  shiftdir         ;  //
                     frac [fix    ]  . mantisse +=  frac[fix^1].mantisse ;  //  fix+=other
 return            frac [fix    ]                                         ;  // NO need to delete new Register VARs -- REG trashes them by Use           

// About Tideness of Code .. I know - I can not ignore it - first & 2nd last Line in MethBody unaligned - I failed there...
// perhaps rename mantisse to val and exponent to xpon? left as is for readability!
// Code should run fast -- MUL/DIV/MOD/SUB/ETC analog

// RXr have to deal that REPLY is in Register:  Frac frac = reply;                                
// Failing IF takes 100CLKS! for avg 50% FailRate avg 50 CLKs. 
// OverHead for IF when Success? .. I omit if i can  about 45 CLKs avg safed - that is about 1x 32Bit MUL!
// lesser rough IMPL of Prototype -- PLZ count IFs! :)
// Most OPs single CLK, but CTOR:? 3x  ADD8|SUB8 ca  12 CLKs   8x PTR but ARRAY in REG =>??
// MUL32 ca 40 CLKs, ADD8 ca 4CLKs -- guess about 80 CLKs but Meth-OverHead 

Shift of Exponent relates to Power of 2 -- so an INC there is a MUL by 2 for Absolute Value - consider Binar Kilo = 1024

Another 16h Work done - I hope this Time WIN VM does not eat my Work again.
Pure Cyan harms PhotoReceptors doubtless - even half Portion appears mysterious.

User avatar
Designer and Programmer
Posts: 2058
Joined: Tue Aug 14, 2007 6:33 pm
Location: Orion

Re: Dynamic resp rotating Galaxies

#20 Post by Bigjoe5 » Thu Jan 30, 2014 4:09 am

Warning: Antarans in dimensional portal are closer than they appear.

User avatar
Space Kraken
Posts: 101
Joined: Mon Jan 06, 2014 3:33 pm

Re: Dynamic resp rotating Galaxies

#21 Post by Adamant » Thu Jan 30, 2014 11:15 am

I dont know to answer that Question in a Way other can resp have to understand ... please read instead shawndream's Post above which deal with.
Pure Cyan harms PhotoReceptors doubtless - even half Portion appears mysterious.

Post Reply