This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a better way to draw a beta-adic monoid (new function plot2) usin…
…g extern C files. I had to change the automaton associated with the beta-adic monoid for WordMorphism.
- Loading branch information
Showing
6 changed files
with
759 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
|
||
struct Complexe | ||
{ | ||
double x,y; | ||
}; | ||
typedef struct Complexe Complexe; | ||
|
||
Complexe prod (Complexe a, Complexe b) | ||
{ | ||
Complexe r; | ||
r.x = a.x*b.x - a.y*b.y; | ||
r.y = a.x*b.y + a.y*b.x; | ||
return r; | ||
} | ||
|
||
Complexe zero () | ||
{ | ||
Complexe r; | ||
r.x = 0; | ||
r.y = 0; | ||
return r; | ||
} | ||
|
||
Complexe un () | ||
{ | ||
Complexe r; | ||
r.x = 1; | ||
r.y = 0; | ||
return r; | ||
} | ||
|
||
Complexe add (Complexe a, Complexe b) | ||
{ | ||
Complexe r; | ||
r.x = a.x + b.x; | ||
r.y = a.y + b.y; | ||
return r; | ||
} | ||
|
||
inline double carre (double x) | ||
{ | ||
return x*x; | ||
} | ||
|
||
double cnorm (Complexe c) | ||
{ | ||
return carre(c.x) + carre(c.y); | ||
} | ||
|
||
Complexe inv (Complexe c) | ||
{ | ||
Complexe r; | ||
double cn = cnorm(c); | ||
r.x = c.x/cn; | ||
r.y = -c.y/cn; | ||
return r; | ||
} |
Oops, something went wrong.