Would appreciate assistance with this data array definition: - struct sun_con
-
{
-
double l;
-
double r;
-
double alpha;
-
double nu;
-
};
-
-
static const struct sun_con con[50] =
-
{{403406.0, 0.0, 4.721964, 1.621043},
-
{195207.0, -97597.0, 5.937458, 62830.348067},
-
{119433.0, -59715.0, 1.115589, 62830.821524},
-
{112392.0, -56188.0, 5.781616, 62829.634302},
-
{ 3891.0, -1556.0, 5.5474 , 125660.5691 },
-
{ 2819.0, -1126.0, 1.5120 , 125660.9845 },
-
more data rows
-
}
-
for (i = 0; i < 50; i++)
-
{
-
arg = con[i].alpha + con[i].nu * u;
-
sum_lon += con[i].l * sin (arg);
-
sum_r += con[i].r * cos (arg);
-
}
1 1397
you could create a sun_con constructor and then initialise the array so (assuming a console application) - struct sun_con
-
{
-
public double l;
-
public double r;
-
public double alpha;
-
public double nu;
-
// constructor
-
public sun_con(double _l, double _r, double _alpha, double _nu)
-
{l=_l; r=_r; alpha=_alpha; nu=_nu; }
-
};
-
-
static
-
sun_con[] con = new sun_con[]{
-
new sun_con(403406.0, 0.0, 4.721964, 1.621043),
-
new sun_con(195207.0, -97597.0, 5.937458, 62830.348067),
-
new sun_con(119433.0, -59715.0, 1.115589, 62830.821524),
-
new sun_con(112392.0, -56188.0, 5.781616, 62829.634302),
-
new sun_con( 3891.0, -1556.0, 5.5474 , 125660.5691 ),
-
new sun_con(2819.0, -1126.0, 1.5120 , 125660.9845 ),
-
//more data rows
-
};
-
-
static void Main(string[] args)
-
{
-
for (int i = 0; i < 6; i++)
-
{
-
Console.WriteLine(" {0} ",con[i].l);
-
//double arg = con[i].alpha + con[i].nu * u;
-
//double sum_lon += con[i].l * sin (arg);
-
//double sum_r += con[i].r * cos (arg);
-
}
-
}
-
prints on the console - 403406
-
195207
-
119433
-
112392
-
3891
-
2819
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Duncan Welch |
last post by:
Good morning,
I have a classic ASP app that I'm converting to .NET. In the existing app
when accessing infrequntly changed data, it reads a database once a day, and
saves the results in an...
|
by: sarah.clough |
last post by:
Hi all,
I have a project that was created in Visual Studio 6 using VB. Is it
possible to open this project in Visual Studio .NET and automatically
convert it into .NET, or do I have to manually...
|
by: asadikhan |
last post by:
I have written a console application that clears out some folders. I
want this application to run as a Windows Service (not a scheduled
task). What is the easiest way to convert this console...
|
by: > Adrian |
last post by:
I have converted a number of applications to enable them to work together on
a network. I have been led to believe that I can do this as follows:
FileStream fs = new FileStream(some code);
while...
|
by: mukeshsrivastav |
last post by:
dear all
Is this possible to convert an application of vb6 to asp.net application .
actually i design one application in vb6 now i want to use this over internet. show needed to be converted to...
|
by: > Adrian |
last post by:
An application I wrote installs ok on W98 and XP. When installed it asks for
Framework 1.1. When the application is installed on Vista and Framework 1.1
is made available, the application installs...
|
by: Ronny |
last post by:
I have a standard C# windows application with one form and some logic around
it.
I need to onvert this exe into a dll class library and use it's
functionality from another exe.
Is there in easy...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |