Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 16:50 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Maximite polygon patterns

     Page 3 of 3    
Author Message
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 06:12am 20 Mar 2019
Copy link to clipboard 
Print this post

Sadly I don't think so.
The circle command can't and I don't see how my code could but it will now nag to my death.
Which is what makes it worth while.

Peter
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1642
Posted: 06:43am 20 Mar 2019
Copy link to clipboard 
Print this post

Have a play with Jim's program on page 2 of this post.

Change st to 1 and it will draw a polygon.
Increase s to make something more like a circle (more points).
change sX to make an ellipse.
remove the pauses for more instant gratification.

Maybe changing the formula to fill allPoints() can do what you want but its a long long time since I did trig.

Bill

PS I thought that changing z might do it but no.
Keep safe. Live long and prosper.
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 06:56am 20 Mar 2019
Copy link to clipboard 
Print this post

Just to go full circle, you probably need matherp with his ability to work in this area
It should be possible to do it dot by dot but that may lead to insanity. Put your feet up and have a think.

Peter
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 07:05am 20 Mar 2019
Copy link to clipboard 
Print this post

The Formula of a ROTATED Ellipse is:

((X−Cx)cos(θ)+(Y−Cy)sin(θ))2(Rx)2+((X−Cx)sin(θ)−(Y−Cy)cos(θ))2(Ry)2=1

I thought this might help

Peter
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1642
Posted: 07:12am 20 Mar 2019
Copy link to clipboard 
Print this post

This link might help too.

Bill
Keep safe. Live long and prosper.
 
maxidavid
Newbie

Joined: 07/03/2019
Location: Australia
Posts: 23
Posted: 07:25am 20 Mar 2019
Copy link to clipboard 
Print this post

OK, Thanks

Super Expander had the circle command with start and end points and angle after the last comma.
You could draw some interesting patterns with the FOR and NEXT commands, changing the draw angle.

I hear some work is being done for MMBasic on the MaxiMite and wondered if this would be considered.

Thanks


 
maxidavid
Newbie

Joined: 07/03/2019
Location: Australia
Posts: 23
Posted: 12:54pm 21 Mar 2019
Copy link to clipboard 
Print this post

Hi,

Sorry, I dont understand:

((X−Cx)cos(θ)+(Y−Cy)sin(θ))2(Rx)2+((X−Cx)sin(θ)−(Y−Cy)cos(θ))2(Ry)2=1

If I want an ellipse rotated 45 degrees it would read.

Circle 1,160,100,65,10,,,45 using Super Expander.

I just think this can be done for MaxiMite since it has the circle, pixel, line, commands. etc.

Sorry if I'm being annoying.

I just want an easy way without complex maths.

example:

FOR A = 0 TO 360 STEP 10
CIRCLE 1,160,100,65,10,,,A
NEXT A

This would draw an ellipse pattern.

Any thoughts ?

Thanks


 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 01:19pm 21 Mar 2019
Copy link to clipboard 
Print this post

  Quote  I just want an easy way without complex maths


You are asking that the complex maths is built into the Maximite.
The problem is that although circles and ellipses symmetrical about x,y can be drawn without using trigonometry, tilted ellipses can't. There is no way I can find of plotting them without effectively rotating a symmetrical ellipse using a normal cosine and sine transformation. This is slow and clunky and would probably have very limited use so I suspect there will be little appetite to include it in Maximite or Micromite firmware.
 
maxidavid
Newbie

Joined: 07/03/2019
Location: Australia
Posts: 23
Posted: 01:32pm 21 Mar 2019
Copy link to clipboard 
Print this post

Hi again,

The MaxiMite is 100's of times faster than a C64 using the Super Expander.
It has 4x the available memory.
The rom for super expander is only 8k.

I dont understand why the equivalent cant be added to the MaxiMite firmware.

What we need is someone to write a small program adding these functions, the program would be 8k or less.

I cant do it :(

Cheers.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 05:08pm 21 Mar 2019
Copy link to clipboard 
Print this post

  maxidavid said   Hi again,

The MaxiMite is 100's of times faster than a C64 using the Super Expander.
It has 4x the available memory.
The rom for super expander is only 8k.

I dont understand why the equivalent cant be added to the MaxiMite firmware.

What we need is someone to write a small program adding these functions, the program would be 8k or less.

I cant do it :(

Cheers.

Maybe you can't but maybe you could find out how it was done on the C64 - algorithm etc - and then someone else can figure if that can be adapted.

Just asking for "more" (Oliver-style) is not actually any help.

In other words, the answer to your "why the equivalent cant be added to the MaxiMite firmware" may be that it could be if you put in the work to find out how it was done on the C64. I'm guessing no-one else feels inclined to put in the effort to do that.

John
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1642
Posted: 01:48am 22 Mar 2019
Copy link to clipboard 
Print this post

David,

Here is a maximite version of Peter Mather's program to draw random ellipses. No fill though. This will draw one ellipse at a random angle and aspect ratio - you can set the angle and aspect ratio in the program.

  Quote  ' Ellipse
'
' Change these next 6 parameters for different Characteristics
'
xp=MM.HRES/2 ' x position of centre
yp=MM.VRES/2 ' y position of centre
s=1 ' size - best <= 1
a=RND()* 360 ' random angle
e=RND()* 8/3 + (1/3) ' random aspect ratio between one third and three
c = green ' line colour
'
'
Points = 60 ' Leave Points at 60 for a closed ellipse
DIM x(Points), y(Points), xd(Points), yd(Points) , xe(Points), ye(Points)
FOR i=0 TO Points 'store coordinates for a 60 point closed circle, radius 100
x(i)=SIN(RAD(i*6)) * 100
y(i)=
COS(RAD(i*6)) * 100
NEXT i

CLS
sine=
SIN(RAD(a)): cosine=COS(RAD(a))
FOR i=0 TO Points ' first convert the aspect ratio and resize the coordinates
xd(i)=x(i) * s * e
yd(i)=y(i) *s
NEXT i
FOR i=0 TO Points ' now rotate the coordinates by an angle between 0 and 360 degrees
xe(i)=xd(i)*cosine - yd(i) * sine + xp
ye(i)=yd(i)*cosine + xd(i) * sine + yp
NEXT i

FOR n = 0 TO Points - 1
' plot lines between nodes
x1 = xe(n)
y1 = ye(n)
x2 = xe(n+
1)
y2 = ye(n+
1)
LINE (x1,y1) - (x2,y2), c
NEXT n


I haven't taken the time to understand what's happening in there - it just works.

BillEdited by Turbo46 2019-03-23
Keep safe. Live long and prosper.
 
maxidavid
Newbie

Joined: 07/03/2019
Location: Australia
Posts: 23
Posted: 02:51am 23 Mar 2019
Copy link to clipboard 
Print this post

Hi,

I had a play with Peters program:



Edited by maxidavid 2019-03-25
 
     Page 3 of 3    
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025