Trignomic Cycle formula

Cableguy

Expert
Licensed User
Longtime User
Inspired by the lattest Token's creation, I've been searching for a way to create an ANALOGIC clock...so started with some research...
and found a reference to a "Trignomic cycle"...
But since I never was that good at trignomics, I just can't see how to port it....
So was looing for some help...
What I need is a "simple" way to draw a radius line from center to the edge of the circle by providing only the angle....
Any one up to it?
 

wolfgang

Member
Licensed User
Longtime User
Clock?

Hi,
first: Erel was faster.

Try this
B4X:
Sub Globals
   i = 0
   a = 0
End Sub

Sub App_Start
   Form1.Show
   Form1.ForeLayer = true
   Form1.Circle (120,120,100,cYellow)
   Timer1.Enabled = true
End Sub

Sub Timer1_Tick
   Form1.FErase(40,40,200,200)
   a = i / 180 * cPI
   Form1.FLine(120,120,120 + 80 * Sin(a),120 - 80 * Cos(a),cRed)
   i = i + 6
End Sub

May be this simple code can help you.
 

Cableguy

Expert
Licensed User
Longtime User
@EREL
Thanks Erel, I keep forgetting about the examples....
Any way I found a few formulas, that I'm gonna try...

Thanks for The help....
 

jp02

Member
Licensed User
Longtime User
Hello,
I'm a crazy man about clock. I did some under µcontroler AVR with motors for moon and earth...

I wonder because I search the file clock.sbp in all directory and I didn't find it
I have a full licence.


thanks to help me

JP Win7, Android 2.2 on a 7'' tablet from VD-tech (gratis!)
 

Stulish

Active Member
Licensed User
Longtime User
Hi,
first: Erel was faster.

Try this
B4X:
Sub Globals
   i = 0
   a = 0
End Sub

Sub App_Start
   Form1.Show
   Form1.ForeLayer = true
   Form1.Circle (120,120,100,cYellow)
   Timer1.Enabled = true
End Sub

Sub Timer1_Tick
   Form1.FErase(40,40,200,200)
   a = i / 180 * cPI
   Form1.FLine(120,120,120 + 80 * Sin(a),120 - 80 * Cos(a),cRed)
   i = i + 6
End Sub

May be this simple code can help you.

I take it from :

Form1.FLine(120,120,120 + 80 * Sin(a),120 - 80 * Cos(a),cRed)

120 + 80 * Sin(a) 120 is the x position, 80 is the radius and a is the angle in radians.

and

120 - 80 * Cos(a) 120 is the y position, again 80 is the radius (if the number is different to the 80 above then you get an ellipse), and a is again the angle in radians.

Just for info :)
 

jp02

Member
Licensed User
Longtime User
Thanks you for your prompt answers, but trigo is not a problem for me (I did an astronomic clock)
the problem is :
where did you find "form"? it is not a View...
it is a module ? how to add it ?

Sorry I write a lot of programme in VB5/6 or in Basic for µ-controleur
much more simple !
and I'm neebie in VB4A and french...

Sub App_Start
Form1.Show
Form1.ForeLayer = true
Form1.Circle (120,120,100,cYellow)
Timer1.Enabled = true
End Sub

Sub Timer1_Tick
Form1.FErase(40,40,200,200)

Best regards
JP
 

klaus

Expert
Licensed User
Longtime User
I wonder because I search the file clock.sbp in all directory and I didn't find it...
Je vois que tu cherches le fichier clock.sbp.
Ce fichier est un fichier code pour Basic4PPC et non pour Basic4Android.
Les codes écrits pour Basic4PPC ne tournent pas sur Basic4Android.
Basic4PPC est le prédécesseur de Basic4Android mais pour Pocket PCs (Windoes Mobile jusqu'à la version 6.5).

Meilleures salutations.

I see that you are looking for clock.sbp.
This file is a code file for Basic4PPC and not for Basic4Android.
Codes written for Basic4PPC don't run in Basic4Android.
Basic4PPC is the predecessor of Basic4Android but for Pocket PCs (Windoes Mobile up to version 6.5).

Best regards.
 
Top