Исследование вычислительной эффективности веб-технологий

Программные средства разработки приложения. Анализ алгоритма решения. Определение попадания точки внутрь фигуры. Анализ вариантов использования программы. Логическое проектирование серверной части. Сравнительный анализ вычислительной эффективности.

Рубрика Программирование, компьютеры и кибернетика
Вид дипломная работа
Язык русский
Дата добавления 16.02.2016
Размер файла 1,5 M

Отправить свою хорошую работу в базу знаний просто. Используйте форму, расположенную ниже

Студенты, аспиранты, молодые ученые, использующие базу знаний в своей учебе и работе, будут вам очень благодарны.

<br></br>

<table border="1">

<tr>

<td>Число точек</td>

<td>Число попавших точек</td>

<td>Площадь Монте-Карло</td>

<td>Точная площадь</td>

<td>Относительная погрешность, %</td>

<td>Время вычисления, мс</td>

</tr>

</table>

</div>

</form>

</body>

</html>

Файл MonteKarlo.asp

<%@ LANGUAGE = "JScript" %>

<% Server.ScriptTimeOut =210%>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">

<title>Расчет площади методом Монте-Карло</title>

<script>

function Reset()

{

MonteKarlo.KoordinX_A.value = "";

MonteKarlo.KoordinX_B.value = "";

MonteKarlo.KoordinX_D.value = "";

MonteKarlo.KoordinY_A.value = "";

MonteKarlo.KoordinY_B.value = "";

MonteKarlo.KoordinY_D.value = "";

}

function Example()

{

MonteKarlo.KoordinX_A.value = "10";

MonteKarlo.KoordinX_B.value = "10";

MonteKarlo.KoordinX_D.value = "40";

MonteKarlo.KoordinY_A.value = "0";

MonteKarlo.KoordinY_B.value = "10";

MonteKarlo.KoordinY_D.value = "0";

}

</script>

<%

var xa=Request.Form("KoordinX_A");

var ya=Request.Form("KoordinY_A");

var xb=Request.Form("KoordinX_B");

var yb=Request.Form("KoordinY_B");

var xd=Request.Form("KoordinX_D");

var yd=Request.Form("KoordinY_D");

var Radius = (yb-ya)/2;

var CentrX = xa;

var CentrY = ya+Radius;

var minX = xa - (yb-ya);

var maxX = xd;

var minY = ya;

var maxY = yb;

var RectangleSquare = ((maxX-minX)*(maxY-minY));;

var pointsCount = 0;

var totalPoints = 0;

var t;

var mca;

var precission = 0;

function CircleSquare()

{

return (Math.PI*Math.pow(Radius,2))/2;

}

function TriangleSquare()

{

var ab = Math.sqrt(Math.pow(xa-xb,2)+Math.pow(ya-yb,2));

var ad = Math.sqrt(Math.pow(xa-xd,2)+Math.pow(ya-yd,2));

var bd = Math.sqrt(Math.pow(xd-xb,2)+Math.pow(yd-yb,2));

var polperim = (ab + ad + bd)/2;

return Math.sqrt(polperim*(polperim-ab)*(polperim-ad)*(polperim-bd)) ;

}

function PointInTriangle(x, y)

{

var a = (x - xa) * (xa - yb) - (xa - xb) * (y - ya);

var b = (x - xb) * (yb - yd) - (xb - xd) * (y - yb);

var c = (x - xd) * (yd - ya) - (xd - xa) * (y - yd);

return ((a >= 0 && b >= 0 && c >= 0) || (a <= 0 && b <= 0 && c <= 0));

}

function PointInCirle(x,y)

{

if (x < (CentrX))

{

return ((Math.pow(x - CentrX, 2) + Math.pow(y - CentrY, 2)) <= Math.pow(Radius, 2));

}

else { return false; }

}

function PointInIceCream(x,y)

{

if (x>CentrX)

{

return PointInTriangle(x,y);

}

else

{

return PointInCirle(x,y);

}

}

function increment(i) {

return 1000 * Math.pow(10, i);

}

function area()

{

return CircleSquare() + TriangleSquare();

}

function Calculate(amountPoints) {

var startTime = new Date;

pointsCount = 0;

for (var i = 0; i < amountPoints; i++)

{

var x = Math.random() * (maxX - minX) + minX;

var y = Math.random() * (maxY - minY) + minY;

if (PointInIceCream(x,y))

{

pointsCount++;

}

}

var endTime = new Date;

t = (endTime.getTime() - startTime.getTime()) / 1000;

mca = RectangleSquare*(pointsCount/amountPoints);

precission = Math.abs(((mca - area()) / area()) * 100);

}

%>

</head>

<body>

<form action = "MonteKarlo.asp" method = "POST" name = "MonteKarlo">

<div id="container">

<img src = "icecream2.jpg" width="50%" align = "right">

<table border="2" width="49%" height = "25%" bgcolor="Azure" bordercolor="Black">

<tr>

<th colspan="3">Координаты треугольника ABD</th>

</tr>

<tr>

<td width="14%">Точка А:</td>

<td width="43%"><input type="text" value = <%=xa%> name="KoordinX_A" size="20"></td>

<td width="43%"><input type="text" value = <%=ya%> name="KoordinY_A" size="20"></td>

</tr>

<tr>

<td width="14%">Точка B:</td>

<td width="43%"><input type="text" value = <%=xb%> name="KoordinX_B" size="20"></td>

<td width="43%"><input type="text" value = <%=yb%> name="KoordinY_B" size="20"></td>

</tr>

<tr>

<td width="14%">Точка E:</td>

<td width="43%"><input type="text" value = <%=xd%> name="KoordinX_D" size="20"></td>

<td width="43%"><input type="text" value = <%=yd%> name="KoordinY_D" size="20"></td>

</tr>

<tr>

</tr>

</table>

<br></br>

<input type="submit" value="Расчитать" name="Okay" width = "20%"></td>

<input type="button" value="Очистить" onclick="Reset()" name="Cancel" width = "20%"id = "Button2">

<input type="button" value="Контрольный пример" onclick="Example()" name="Cancel" width = "20%"id = "Button3">

<br></br>

<table border = "1">

<tr>

<td>Число точек</td>

<td>Число попавших точек</td>

<td>Площадь Монте-Карло</td>

<td>Точная площадь</td>

<td>Относительная погрешность, %</td>

<td>Время вычисления, мс</td>

</tr>

<%for (var i = 3; i < 8; i++) {

totalPoints = Math.pow(10,i);

Calculate(totalPoints);

%>

<tr>

<td><%=totalPoints%></td>

<td><%=pointsCount %></td>

<td><%=mca.toFixed(4)%></td>

<td><%=area().toFixed(4)%></td>

<td><%=precission.toFixed(4) %></td>

<td><%=t %></td>

</tr>

<% } %>

</table>

</div>

</form>

</body>

</html>

Файл Point (Файлы веб-приложения на базе WPF/ASMX/C#)

using System;

using System.Collections.Generic;

using System.Web;

/// <summary>

/// Сводное описание для Point

/// </summary>

public class Point

{

public Point()

{

//

// TODO: добавьте логику конструктора

//

}

private float x, y;

public Point(float a, float b) { x = a; y = b; }

public float PointX

{

get

{ return x; }

}

public float PointY

{

get

{ return y; }

}

}

Файл IceCream.cs

using System;

using System.Collections.Generic;

using System.Web;

/// <summary>

/// Сводное описание для IceCream

/// </summary>

///

namespace WSMK

{

public class IceCream

{

private

Triangle abe;

Circle ab;

Rectangle abcd;

public

IceCream()

{

}

public IceCream(Point a, Point b, Point e)

{

abe = new Triangle(a, b, e);

ab = new Circle(a, b);

abcd = new Rectangle(ab.MinX, abe.MaxX, abe.MinY, abe.MaxY);

}

public bool PointInIceCream(Point randP)

{

if (randP.PointX > (ab.CentrPoint.PointX))

{ return abe.PointInLines(randP); }

else

{ return ab.PointInCircle(randP); }

}

public float realSquare() { return (abe.Square() + ab.Square()); }

public float minX

{

get

{

return ab.MinX;

}

}

public float maxX

{

get

{

return abe.MaxX;

}

}

public float minY

{

get

{

return abe.MinY;

}

}

public float maxY

{

get

{

return abe.MaxY;

}

}

public float MonteKarloSquare(int count, out int numberPoints, out float rel_delta)

{

Random rand = new Random();

numberPoints = 0;

//DateTime start_date_time = DateTime.Now;

for (int k = 0; k < count; k++)

{

Point p = new Point(minX + (float)(rand.NextDouble() * (maxX - minX)),

minY + (float)(rand.NextDouble() * (maxY - minY)));

if (PointInIceCream(p))

{

numberPoints++;

}

}

//DateTime end_date_time = DateTime.Now;

float MK_Square = abcd.Square() * ((float)numberPoints / (float)count);

rel_delta = (float)Math.Round((Math.Abs((MK_Square - realSquare()) * 100) / realSquare()) * 10000) / (float)10000.0;

return MK_Square;

}

}

class Triangle

{

private

Point a, b, e;

float k1;

float k2;

public

Triangle(Point p1, Point p2, Point p3)

{

a = p1; b = p2; e = p3;

k1 = (e.PointY - a.PointY) / (e.PointX - a.PointX);

k2 = (e.PointY - b.PointY) / (e.PointX - b.PointX);

}

public float Square()

{

float ab = (float)Math.Sqrt(Math.Pow((a.PointX - b.PointX), 2) + Math.Pow((a.PointY - b.PointY), 2));

float ae = (float)Math.Sqrt(Math.Pow((a.PointX - e.PointX), 2) + Math.Pow((a.PointY - e.PointY), 2));

float be = (float)Math.Sqrt(Math.Pow((b.PointX - e.PointX), 2) + Math.Pow((b.PointY - e.PointY), 2));

float polperim = (ab + ae + be) / 2.0f;

return (float)Math.Sqrt((polperim * (polperim - ab) * (polperim - ae) * (polperim - be)));

}

public bool PointInLines(Point p)

{

if ((((p.PointX - a.PointX) * k1 + a.PointY) >= p.PointY) || (((p.PointX - b.PointX) * k2 + b.PointY) <= p.PointY))

{

return true;

}

else

{

return false;

}

}

public float MaxX

{

get

{

return e.PointX;

}

}

public float MinY

{

get

{

return a.PointY;

}

}

public float MaxY

{

get

{

return b.PointY;

}

}

}

class Circle

{

private

Point Centr;

float r;

public

Circle(Point p1, Point p2)

{

r = (p2.PointY - p1.PointY) / 2;

Centr = new Point(p1.PointX, p1.PointY + r);

}

public float Square()

{

return (float)(Math.PI * Math.Pow(r, 2) / 2.0);

}

public bool PointInCircle(Point p1)

{

if (p1.PointX < Centr.PointX)

{

return ((Math.Pow(p1.PointX - Centr.PointX, 2) + Math.Pow(p1.PointY - Centr.PointY, 2)) <= Math.Pow(r, 2));

}

else { return false; }

}

public float MinX

{

get

{

return Centr.PointX - r;

}

}

public Point CentrPoint

{

get

{

return Centr;

}

}

}

class Rectangle

{

private

float MinX, MaxX, MinY, MaxY;

public

Rectangle(float MiX, float MaX, float MiY, float MaY)

{

MinX = MiX;

MaxX = MaX;

MinY = MiY;

MaxY = MaY;

}

public float Square()

{

return (MaxX - MinX) * (MaxY - MinY);

}

}

}

Файл WebServiceMK.asmx

<%@ WebService Language="C#" CodeBehind="~/App_Code/WS_MonteKarlo.cs" Class="WSMK.WS_MonteKarlo" %>

Файл WebServiceMK.cs

using System;

using System.Collections.Generic;

using System.Web;

using System.Web.Services;

//[WebService(Namespace = "http://tempuri.org/")]

//[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

namespace WSMK

{

public class WS_MonteKarlo : System.Web.Services.WebService

{

public WS_MonteKarlo()

{

//Раскомментируйте следующую строку в случае использования сконструированных компонентов

//InitializeComponent();

}

[WebMethod]

public float MK_Square(float ax, float ay, float bx, float by, float ex, float ey, int count, out int numberPoints, out float real_delta, out float realsquare, out DateTime start, out DateTime end)

{

Point a = new Point(ax, ay);

Point b = new Point(bx, by);

Point e = new Point(ex, ey);

start = DateTime.Now;

IceCream icecream = new IceCream(a, b, e);

float montekarloSquare = icecream.MonteKarloSquare(count, out numberPoints, out real_delta);

realsquare = icecream.realSquare();

end = DateTime.Now;

return montekarloSquare;

}

}

Файл MainWindow.aspx

<Page x:Class="app3.Page1"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

mc:Ignorable="d"

d:DesignHeight="300" d:DesignWidth="300"

Title="Page1">

<Grid Margin="0,0,-326,0">

<TextBox x:Name="KoordinX_A" HorizontalAlignment="Left" Height="23" Margin="61,52,0,0" TextWrapping="Wrap" Text="-8" VerticalAlignment="Top" Width="54" LostFocus="LostFocusTB"/>

<TextBox x:Name="KoordinX_B" HorizontalAlignment="Left" Height="23" Margin="61,75,0,0" TextWrapping="Wrap" Text="-8" VerticalAlignment="Top" Width="54" LostFocus="LostFocusTB"/>

<TextBox x:Name="KoordinX_D" HorizontalAlignment="Left" Height="23" Margin="61,98,0,0" TextWrapping="Wrap" Text="37" VerticalAlignment="Top" Width="54" LostFocus="LostFocusTB"/>

<TextBox x:Name="KoordinY_A" HorizontalAlignment="Left" Height="23" Margin="146,52,0,0" TextWrapping="Wrap" Text="-9" VerticalAlignment="Top" Width="54" LostFocus="LostFocusTB"/>

<TextBox x:Name="KoordinY_B" HorizontalAlignment="Left" Height="23" Margin="146,75,0,0" TextWrapping="Wrap" Text="17" VerticalAlignment="Top" Width="54" LostFocus="LostFocusTB"/>

<TextBox x:Name="KoordinY_D" HorizontalAlignment="Left" Height="23" Margin="146,98,0,0" TextWrapping="Wrap" Text="-9" VerticalAlignment="Top" Width="54" LostFocus="LostFocusTB"/>

<Button x:Name="Button1" Content="Расчёт" HorizontalAlignment="Left" Margin="243,49,0,0" VerticalAlignment="Top" Width="149" RenderTransformOrigin="0.427,0.455" Click="Button1_Click"/>

<ListBox x:Name="List" HorizontalAlignment="Left" Height="153" Margin="0,147,0,0" VerticalAlignment="Top" Width="626"/>

<Label Content="A" HorizontalAlignment="Left" Margin="10,49,0,0" VerticalAlignment="Top"/>

<Label Content="B" HorizontalAlignment="Left" Margin="10,73,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.623,0.128"/>

<Label Content="D" HorizontalAlignment="Left" Margin="10,98,0,0" VerticalAlignment="Top"/>

<Label Content="X" HorizontalAlignment="Left" Margin="68,21,0,0" VerticalAlignment="Top"/>

<Label Content="Y" HorizontalAlignment="Left" Margin="153,21,0,0" VerticalAlignment="Top"/>

<Button x:Name="Button2" Content="Очистить" HorizontalAlignment="Left" Margin="243,73,0,0" VerticalAlignment="Top" Width="149" Click="Button2_Click"/>

<Button x:Name="Button3" Content="Контрольный пример" HorizontalAlignment="Left" Margin="243,99,0,0" VerticalAlignment="Top" Width="149" Click="Button3_Click"/>

</Grid>

</Page>

Файл MainWindow.aspx.cs

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows;

using System.Windows.Controls;

using System.Windows.Data;

using System.Windows.Documents;

using System.Windows.Input;

using System.Windows.Media;

using System.Windows.Media.Imaging;

using System.Windows.Navigation;

using System.Windows.Shapes;

using System.Threading;

using app3.ServiceReference1;

namespace app3

{

/// <summary>

/// Логика взаимодействия для Page1.xaml

/// </summary>

public partial class Page1 : Page

{

public Page1()

{

InitializeComponent();

}

WS_MonteKarloSoapClient newMK = new WS_MonteKarloSoapClient();

public delegate float DelegateWithParameters(float ax, float ay, float bx, float by, float ex, float ey, int count, out int numberPoints, out float real_delta, out float realsquare, out DateTime start, out DateTime end);

float ax = -8;

float bx = -8;

float dx = 37;

float ay = -9;

float by = 17;

float dy = -9;

private bool check()

{

bool result = true; // ошибок нет

float Number;

string Error = "";

if (float.TryParse(KoordinY_A.Text, out Number)) // проверка координаты Y точки А

{

if (float.Parse(KoordinY_A.Text) >= float.Parse(KoordinY_B.Text))

{

Error += "Координата Y точки A не может быть больше координаты Y точки В ";

KoordinY_A.Text = ay.ToString();

result = false;

}

if (float.Parse(KoordinY_A.Text) > float.Parse(KoordinY_D.Text))

{

Error += "Координата Y точки A не может быть больше координаты Y точки D";

KoordinY_A.Text = ay.ToString();

result = false;

}

}

else

{

result = false;

}

if (float.TryParse(KoordinY_B.Text, out Number)) // проверка координаты Y точки B

{

if (float.Parse(KoordinY_B.Text) <= float.Parse(KoordinY_A.Text))

{

Error += "Координата Y точки B не может быть меньше координаты Y точки А";

KoordinY_B.Text = by.ToString();

result = false;

}

if (float.Parse(KoordinY_B.Text) <= float.Parse(KoordinY_D.Text))

{

Error += "Координата Y точки B не может быть меньше координаты Y точки D";

KoordinY_B.Text = by.ToString();

result = false;

}

}

else

{

result = false;

}

if (float.TryParse(KoordinX_A.Text, out Number)) //проверка координаты Х точки А

{

if (float.Parse(KoordinX_A.Text) >= float.Parse(KoordinX_D.Text))

{

Error += "Координата X точки A не может быть больше координаты X точки D";

KoordinX_A.Text = ax.ToString();

result = false;

}

}

else

{

result = false;

}

if (float.TryParse(KoordinX_B.Text, out Number)) //проверка координаты Х точки B

{

if (float.Parse(KoordinX_B.Text) >= float.Parse(KoordinX_D.Text))

{

Error += "Координата X точки B не может быть больше координаты X точки D";

KoordinX_B.Text = bx.ToString();

result = false;

}

}

else

{

result = false;

}

if (float.TryParse(KoordinX_D.Text, out Number)) //проверка координаты Х точки Е

{

if ((float.Parse(KoordinX_D.Text) <= float.Parse(KoordinX_A.Text)) || (float.Parse(KoordinX_D.Text) <= float.Parse(KoordinX_B.Text)))

{

Error += "Координата X точки D не может быть меньше координаты X точки А и В";

KoordinX_D.Text = dx.ToString();

result = false;

}

}

else

{

result = false;

}

if (float.TryParse(KoordinY_D.Text, out Number)) // проверка координаты Y точки Е

{

if ((float.Parse(KoordinY_D.Text) < float.Parse(KoordinY_A.Text)))

{

Error += "Координата Y точки D не может быть меньше координаты Y точки А";

KoordinY_D.Text = dy.ToString();

result = false;

}

if ((float.Parse(KoordinY_D.Text) >= float.Parse(KoordinY_B.Text)))

{

Error += "Координата Y точки D не может быть больше координаты Y точки В";

KoordinY_D.Text = dy.ToString();

result = false;

}

}

else

{

result = false;

}

if (result == false)

{

MessageBox.Show(Error, "Введено некорректное значение координат", MessageBoxButton.OK, MessageBoxImage.Warning);

return result;

}

else

{

return result;

}

}

private void LostFocusTB(object sender, RoutedEventArgs ee)

{

TextBox EventTextBox = (TextBox)sender;

float Number = 0.0f;

string TextInTextBox = EventTextBox.Text.Replace(".", ",");

if (float.TryParse(TextInTextBox, out Number))

{

if (EventTextBox.Equals(KoordinX_A)) // проверка координаты X точки А

{

KoordinX_B.Text = KoordinX_A.Text;

ax = float.Parse(KoordinX_A.Text);

bx = float.Parse(KoordinX_B.Text);

}

if (EventTextBox.Equals(KoordinX_B)) // проверка координаты X точки B

{

KoordinX_A.Text = KoordinX_B.Text;

bx = float.Parse(KoordinX_B.Text);

ax = float.Parse(KoordinX_A.Text);

}

if (EventTextBox.Equals(KoordinX_D)) // проверка координаты X точки D

{

dx = float.Parse(KoordinX_D.Text);

}

if (EventTextBox.Equals(KoordinY_A)) // проверка координаты Y точки A

{

KoordinY_D.Text = ay.ToString();

dy = float.Parse(KoordinY_D.Text);

ay = float.Parse(KoordinY_A.Text);

}

if (EventTextBox.Equals(KoordinY_B)) // проверка координаты Y точки B

{

by = float.Parse(KoordinY_B.Text);

}

if (EventTextBox.Equals(KoordinY_D)) // проверка координаты Y точки D

{

ay = float.Parse(KoordinY_A.Text);

dy = float.Parse(KoordinY_D.Text);

KoordinY_A.Text = dy.ToString();

}

if (KoordinX_A.Text != "" && KoordinX_B.Text != "" && KoordinX_D.Text != "" && KoordinY_A.Text != ""

&& KoordinY_B.Text != "" && KoordinY_D.Text != "")

{

Button1.IsEnabled = true;

}

else

{

Button1.IsEnabled = false;

}

}

else

{

MessageBoxResult cur_result = MessageBox.Show("Введено некорректное значение координаты\n",

//"Будет поставлено предыдущее значение",

"Введено некорректное значение координаты", MessageBoxButton.OK,

MessageBoxImage.Exclamation);

if (cur_result == MessageBoxResult.OK)

{

if (EventTextBox.Equals(KoordinX_A))

{

KoordinX_A.Text = ax.ToString();

}

if (EventTextBox.Equals(KoordinX_B))

{

KoordinX_B.Text = bx.ToString();

}

if (EventTextBox.Equals(KoordinX_D))

{

KoordinX_D.Text = dx.ToString();

}

if (EventTextBox.Equals(KoordinY_A))

{

KoordinY_A.Text = ay.ToString();

}

if (EventTextBox.Equals(KoordinY_B))

{

KoordinY_B.Text = by.ToString();

}

if (EventTextBox.Equals(KoordinY_D))

{

KoordinY_D.Text = ay.ToString();

}

}

}

}

private void Button1_Click(object sender, RoutedEventArgs e)

{

if (check())

{

DelegateWithParameters delFoo = new DelegateWithParameters(newMK.MK_Square);

List.Items.Clear();

string one_line;

List.Items.Add("Кол-во точек " + "Попавшие точки " + "S Монте-Карло " + "Реальная S " + "Погрешность " + "Время расчёта, мc");

for (int i = 3; i < 8; i++)

{

string space = " ";

int numberPoints = 0;

float rel_delta = 0;

float square = 0;

int count = (int)Math.Pow(10, i);

DateTime start;

DateTime end;

Button1.Visibility = Visibility.Hidden;

IAsyncResult MKtag = delFoo.BeginInvoke(ax, ay, bx, by, dx, dy, count, out numberPoints, out rel_delta, out square, out start, out end, null, null);

float MKResult = delFoo.EndInvoke(out numberPoints, out rel_delta, out square, out start, out end, MKtag);

TimeSpan arv_time = end - start;

for (int j = 1; j < 9 - i; j++) { space += " "; }

one_line = Math.Pow(10, i) + space + " " + numberPoints.ToString() + space + " " + MKResult.ToString(format: "F") + " " +

square.ToString(format: "F") + " " + rel_delta.ToString(format: "F") + "% " + arv_time.TotalMilliseconds;

List.Items.Add(one_line); //List.Items.Add("____________________________");

Button1.Visibility = Visibility.Visible;

}

}

else { }

}

private void Button2_Click(object sender, RoutedEventArgs ee)

{

KoordinX_A.Text = KoordinX_B.Text =

KoordinX_D.Text = KoordinY_A.Text =

KoordinY_B.Text = KoordinY_D.Text = "";

Button1.IsEnabled = false;

}

private void Button3_Click(object sender, RoutedEventArgs ee)

{

ax = bx = -8;

dx = 37;

ay = dy = -9;

by = 17;

KoordinX_A.Text = ax.ToString();

KoordinX_B.Text = bx.ToString();

KoordinX_D.Text = dx.ToString();

KoordinY_A.Text = ay.ToString();

KoordinY_B.Text = by.ToString();

KoordinY_D.Text = dy.ToString();

Button1.IsEnabled = true;

}

}

}

[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/MK_Square", ReplyAction="*")]

System.Threading.Tasks.Task<app3.ServiceReference1.MK_SquareResponse> MK_SquareAsync(app3.ServiceReference1.MK_SquareRequest request);

}

[System.Diagnostics.DebuggerStepThroughAttribute()]

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]

[System.ServiceModel.MessageContractAttribute(WrapperName="MK_Square", WrapperNamespace="http://tempuri.org/", IsWrapped=true)]

public partial class MK_SquareRequest {

[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=0)]

public float ax;

[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=1)]

public float ay;

[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=2)]

public float bx;

[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=3)]

public float by;

[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=4)]

public float ex;

[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=5)]

public float ey;

[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=6)]

public int count;

public MK_SquareRequest() {

}

public MK_SquareRequest(float ax, float ay, float bx, float by, float ex, float ey, int count) {

this.ax = ax;

this.ay = ay;

this.bx = bx;

this.by = by;

this.ex = ex;

this.ey = ey;

this.count = count;

}

}

[System.Diagnostics.DebuggerStepThroughAttribute()]

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]

[System.ServiceModel.MessageContractAttribute(WrapperName="MK_SquareResponse", WrapperNamespace="http://tempuri.org/", IsWrapped=true)]

public partial class MK_SquareResponse {

[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=0)]

public float MK_SquareResult;

[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=1)]

public int numberPoints;

[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=2)]

public float real_delta;

[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=3)]

public float realsquare;

[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=4)]

public System.DateTime start;

[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=5)]

public System.DateTime end;

public MK_SquareResponse() {

}

public MK_SquareResponse(float MK_SquareResult, int numberPoints, float real_delta, float realsquare, System.DateTime start, System.DateTime end) {

this.MK_SquareResult = MK_SquareResult;

this.numberPoints = numberPoints;

this.real_delta = real_delta;

this.realsquare = realsquare;

this.start = start;

this.end = end;

}

}

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]

public interface WS_MonteKarloSoapChannel : app3.ServiceReference1.WS_MonteKarloSoap, System.ServiceModel.IClientChannel {

}

[System.Diagnostics.DebuggerStepThroughAttribute()]

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]

public partial class WS_MonteKarloSoapClient : System.ServiceModel.ClientBase<app3.ServiceReference1.WS_MonteKarloSoap>, app3.ServiceReference1.WS_MonteKarloSoap {

public WS_MonteKarloSoapClient() {

}

public WS_MonteKarloSoapClient(string endpointConfigurationName) :

base(endpointConfigurationName) {

}

public WS_MonteKarloSoapClient(string endpointConfigurationName, string remoteAddress) :

base(endpointConfigurationName, remoteAddress) {

}

public WS_MonteKarloSoapClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :

base(endpointConfigurationName, remoteAddress) {

}

public WS_MonteKarloSoapClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :

base(binding, remoteAddress) {

}

[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]

app3.ServiceReference1.MK_SquareResponse app3.ServiceReference1.WS_MonteKarloSoap.MK_Square(app3.ServiceReference1.MK_SquareRequest request) {

return base.Channel.MK_Square(request);

}

public float MK_Square(float ax, float ay, float bx, float by, float ex, float ey, int count, out int numberPoints, out float real_delta, out float realsquare, out System.DateTime start, out System.DateTime end) {

app3.ServiceReference1.MK_SquareRequest inValue = new app3.ServiceReference1.MK_SquareRequest();

inValue.ax = ax;

inValue.ay = ay;

inValue.bx = bx;

inValue.by = by;

inValue.ex = ex;

inValue.ey = ey;

inValue.count = count;

app3.ServiceReference1.MK_SquareResponse retVal = ((app3.ServiceReference1.WS_MonteKarloSoap)(this)).MK_Square(inValue);

numberPoints = retVal.numberPoints;

real_delta = retVal.real_delta;

realsquare = retVal.realsquare;

start = retVal.start;

end = retVal.end;

return retVal.MK_SquareResult;

}

public System.Threading.Tasks.Task<app3.ServiceReference1.MK_SquareResponse> MK_SquareAsync(app3.ServiceReference1.MK_SquareRequest request) {

return base.Channel.MK_SquareAsync(request);

}

}

}

Размещено на Allbest.ur


Подобные документы

Работы в архивах красиво оформлены согласно требованиям ВУЗов и содержат рисунки, диаграммы, формулы и т.д.
PPT, PPTX и PDF-файлы представлены только в архивах.
Рекомендуем скачать работу.