How to resolve the algorithm Superellipse step by step in the Yabasic programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Superellipse step by step in the Yabasic programming language

Table of Contents

Problem Statement

A superellipse is a geometric figure defined as the set of all points (x, y) with

where n, a, and b are positive numbers.

Draw a superellipse with n = 2.5, and a = b = 200

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Superellipse step by step in the Yabasic programming language

Source code in the yabasic programming language

open window 700, 600
backcolor 0,0,0
clear window 

a=200
b=200
n=2.5
na=2/n
t=.01
color 0,0,255
for i = 0 to 314
    xp=a*sig(cos(t))*abs((cos(t)))^na+350
    yp=b*sig(sin(t))*abs((sin(t)))^na+275
    t=t+.02
    line to xp, yp
next i

  

You may also check:How to resolve the algorithm Abstract type step by step in the Visual Basic programming language
You may also check:How to resolve the algorithm Metaprogramming step by step in the Ring programming language
You may also check:How to resolve the algorithm Empty program step by step in the Asymptote programming language
You may also check:How to resolve the algorithm Chinese remainder theorem step by step in the R programming language
You may also check:How to resolve the algorithm Exponentiation operator step by step in the Forth programming language