This commit is contained in:
uns2en69
2026-02-18 02:54:17 +03:00
commit b6f78044a0
49 changed files with 660 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
### IntelliJ IDEA ###
out/
!**/src/main/**/out/
!**/src/test/**/out/
.kotlin
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store
+3
View File
@@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_25" default="true" project-jdk-name="openjdk-25" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/laba3.iml" filepath="$PROJECT_DIR$/laba3.iml" />
</modules>
</component>
</project>
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
+66
View File
@@ -0,0 +1,66 @@
import java.lang.runtime.SwitchBootstraps;
import java.util.Scanner;
import static java.lang.Math.*;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Введите координаты точки x и y:");
System.out.print("x=");
double x = in.nextDouble();
System.out.print("y=");
double y = in.nextDouble();
String s = "";
int i = 0;
double pl = 0;
String S;
if (x == 0 && y == 0) {
S = "в начале координат";
System.out.println(S);
} else if ((pow(x - 1, 2) + pow(y, 2) > 1) && (x > 0) && (pow(x, 2) + pow(y, 2) > 1) && (pow(x, 2) + pow(y - 1, 2) < 1)) {
String $ = "В области M1";
i = 1;
} else if ((pow(x + 1, 2) + pow(y, 2) < 1) && (pow(x, 2) + pow(y - 1, 2) < 1)) {
S = "В области M2";
i = 2;
System.out.println(S);
}else if((y>0)&&(pow(x,2)+pow(y-1,2)>1)&&(pow(x-1,2)+pow(y,2)<1)) {
S = "В области M3";
i = 3;
System.out.println(S);
}else if ((y<0)&&(pow(x+1,2)+pow(y,2)>1&&(pow(x-1,2))+pow(y,2)>1)&&(pow(x,2)+pow(y,2)<1)) {
S = "В области M4";
i = 4;
System.out.println(S);
}else if ((pow(x,2)+pow(y+1,2)>1)&&(x>-2)&&(x<0)&&(y>-2)&&(y<-1)) {
S = "В области M5";
i = 5;
System.out.println(S);
}else {
S = "вне всех обозначенных областей";
System.out.println(S);
}
System.out.println("Положение точки:"+s);
switch(i) {
case 1:
pl = pl / 4 + 1 - pl / 6 - sqrt(3) / 4;
break;
case 2:
pl = (pl / 2 - 1);
break;
case 3:
pl = 1 - pl / 4 + pl / 4;
break;
case 4:
pl = (sqrt(3) / 4 - pl / 12) * 2;
break;
case 5:
pl = 1 + 1 - pl / 4;
break;
}
if(i!=0)
System.out.printf("Площадь M% d:%.3f",i,pl);
}
}