DataMuseum.dk

Presents historical artifacts from the history of:

Commodore CBM-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Commodore CBM-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦c43b8a0ac⟧ TextFile

    Length: 580 (0x244)
    Types: TextFile
    Notes: UNIX file
    Names: »polar.c«

Derivation

└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
    └─⟦2d53db1df⟧ UNIX V7 Filesystem
        └─ ⟦this⟧ »frankh/gsrc/polar.c« 

TextFile

#include	<stdio.h>
#include	<math.h>

double	line(),
	point(),
	sin(),
	clear();

main()
{

	double x, xx, y,
		theta, r;
	clear();
	axis();

	for (theta = -PI; theta < PI; theta = theta + 0.005) {

		r = (sin(theta*theta*theta) * sin(theta)*cos(theta)*cos(theta));
		x = r * cos(theta);	/* generate rectangular co-ord	*/
		y = r * sin(theta);

		x = x * 500.0 * 4.0;
		y = y * 380.0 * 4.0;


/*		y = (int)(sqrt(sin(xx) * cos(xx)) * 399.0);
		y = (int)((sin(xx) * (x/6)) * 4.0);	*/
		plot( (int)x, (int)y);
	}
}

plot(x,y)
int x,y;
{
	x = x + 511;
	y = y + 399;
	point( x, y);

}