GithubHelp home page GithubHelp logo

Comments (3)

stevesims avatar stevesims commented on July 22, 2024

there is a bug here in the Agon plot implementation, but it's not really what you're describing.

Acorn's VDU system has the concept of a "graphics cursor", but essentially, simplified, it just keeps track of the last point given in a drawing command.

to draw a circle you first need to move to a point at x,y coordinates which will be the centre of the circle, and you then need to use a circle plot command to a different x, y position. when the circle is draw, the graphics cursor should be left at that x,y position.

that is the behaviour you have been seeing in JSBeeb. the cursor is left where you told it to be positioned, i.e. the coordinates you gave to the circle PLOT command. that can actually be anywhere around the circumference of the circle, not just at a position of 45 degrees. rather than being "very dozy" I'd argue this behaviour is highly logical and easily understood.

the bug in the Agon plot implementation is that it is not updating the graphics cursor position after drawing the circle, so is leaving the graphics cursor at the centre of the circle. (in both cases the graphics cursor position is completely determinate.). this likely affects several other plot operations too. I will raise a pull request to fix this.

from agon-vdp.

paulscottrobson avatar paulscottrobson commented on July 22, 2024

Yes ... but it doesn't. That was the point. On the BBC Master, which has the GXR built in, it leaves it on the circle circumference. This is probably because they do an algorithm for 45 degrees on the circle ; you can do the rest with mirroring ; flipping ; rotating, and the line 1/2 way up to the top was the last horizontal filled line drawn and they just forgot to put it back. The design of circle is really illogical. Rectangle drawing works as one might expect , providing the coordinates of opposite corners, whereas for circle you provide the radius, which really should be a bounding box, which could be limited to circles and is extensible to ellipses.

from agon-vdp.

stevesims avatar stevesims commented on July 22, 2024

I ran up JSBeeb, selected BBC Master, drew some circles using the GXR command, and the cursor was always, consistently, left at the X,Y position used to plot the circle. every single time. it is categorically not restricted to be at a 45 degree angle

as an example, try:

MOVE 500,500
PLOT &95,700,500
PLOT 5,200,200

you will see a circle drawn, centred on 500,500, and then a line from the right hand edge of the circle, starting at 700,500, down to 200,200. that 700,500 point is most definitely not at 45 degrees to the centre of the circle - it's on the same line. change that 700,500 to anything you like and the circle will be drawn to intersect with that point, and the cursor left at the point given.

your interpretation of Acorn's circle drawing algorithm is simply incorrect.

their algorithm is for the user to specify the centre point, and then specify any point on the circumference of the circle. I'd say that's pretty logical, and easily understood. we're not going to adopt a different algorithm for the Agon.

the bug in the agon-vdp implementation, which has since been fixed, was that the Agon VDP wasn't moving the cursor after drawing the circle. the cursor was being left and the centre. when I fixed the bug I did so directly comparing the Agon VDP behaviour to the BBC Master GXR running on JSBeeb. the behaviour how matches. as an extra layer of verification, I also ran up an Archimedes emulator, and behaviour matches there too

Acorn's VDU system does also support drawing ellipses but that is not done using a "bounding box" approach. if I've understood what you're suggesting, that would not provide true ellipse support, but rather squashed circles, which are a different thing and not directly supported by Acorn's VDU system. for now we don't offer any ellipse support. if this ever gets added, we are more likely to support Acorn's style of ellipses than the simpler squashed circles

from agon-vdp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.